0
votes

I am attempting to create a Robot Framework Selenium test where I input text into a Kendo grid filter and then check the results. The grid is here:

Kendo Grid example screenshot

The filter code is here:

<thead class="k-grid-header" xpath="1">
  <tr>...</tr>
  <tr>
    <td class="rowFilterContainer"></td>
    <td class="rowFilterContainer"></td>
    <td class="rowFilterContainer" data-field="UserId"></td>
    <td class="rowFilterContainer" data-field="CandidateId">
      <input class="rowFilter" data-field="CanddateId" data-type="string" type="text" data- 
      operator="startswith">
    </td>

I am attempting to locate and then enter text in the CandidateId field using Selenium with an xpath of "//div[@id='Tab_0']//td[4]//input[1]" but when I run the test if complains that it cannot find it.

Any help on how to find this field (with a better xpath) and to add the text would be greatly appreciated. I have tried using CSS as well.

rest of HTML

2
Is it possible that this field is generated when you click on it? So first Click Element //td[@data-field='CandidateId'] and then Input Text //td[@data-field='CandidateId']/input - A. Kootstra
I've never used Kendo Grid. It looks like the sort of thing that might be in an iframe. Is it in an iframe? - Bryan Oakley
Thanks for your reply. The data is there without clicking the actual field - marklane2001
Can you post a link to the page you are automating, or the full page HTML? Given the obvious //td/input XPath isn't working here, there's definitely something else going on with that page. With your current HTML sample, it is very difficult to troubleshoot the issue - CEH
Hi, I have added a screenshot (rest of HTML) link above with the code above - marklane2001

2 Answers

0
votes

Try this xpath:

//td[@data-field='CandidateId']/input
0
votes

Try this:

(.//thead[@class='k-grid-header']/tr)[2]/td[4]/input[@class='rowFilter']