0
votes

I have a check box inside a table and I am not able to check it using Seleinum Webdriver in Java. I'm using version 2.52.0 of Selenium. It doesn't matter which web browser I use, I always get an element not found error. I know that my iFrame is correct because I can click on every other component on this same screen.

Here's a picture of the screen:

Screen Shot

And here's the HTML code:

<div id="j_id_jsp_2033766868_1pc7:innerTbl::db" class="x13r" _afrcolcount="4" style="position: relative; width: 958px; overflow: hidden; height: 320px; z-index: 1;">
  <table class="x13s x14j" cellspacing="0" _startrow="0" _rowcount="3" _selstate="{}" _totalwidth="395" style="table-layout: fixed; position: relative; width: 958px;">
    <tbody>
      <tr class="p_AFHighlighted x13q" _afrrk="0">
        <td class="xir" nowrap="" align="left" style="width:25px;">
        <td class="xir" nowrap="" align="left" style="width:50px;">
          <span id="j_id_jsp_2033766868_1pc7:innerTbl:0:select" class="p_AFHoverTarget x20j x1v" _adftrc="j_id_jsp_2033766868_1pc7:innerTbl:0:select::icon-style">
          <span class="x2e">
          <span class="xk2">
            <input id="j_id_jsp_2033766868_1pc7:innerTbl:0:select::content" class="xtj" type="checkbox" value="t" name="j_id_jsp_2033766868_1pc7:innerTbl:0:select"/>
          </span>
          </span>
          </span>
        </td>
        <td class="xir" nowrap="" align="left" style="width:100px;">
        <td class="xir" nowrap="" align="left" style="width: 763px;">
      </tr>
      <tr class="x13q" _afrrk="1">
      <tr class="x13q" _afrrk="2">
    </tbody>
  </table>
</div>

I have mapped my xPath as:

//*[@id='j_id_jsp_2033766868_1pc7:innerTbl:0:select::content']

and

//*[@name='j_id_jsp_2033766868_1pc7:innerTbl:0:select']

and

//*[@id='j_id_jsp_2033766868_1pc7:innerTbl::db']/table/tbody/tr/td/td/span/span/span/input

Any ideas? Thanks in advance!

1
post your HTML code here in question while not as an image .. people will look into better then looking into image - Shubham Jain
Thanks Shubham, I've edited the post to show the HTML code - Jay

1 Answers

1
votes

it looks like you can take help from value attribute

//input[@value='t']

I just now posted answer here to click on element by actions and also by using Javascript execution if normal click does not works as expected.

Thank You, Murali