Robot Framework - get span element from table
<p>I'm trying to write some test cases to automatically test my websites but I'm having trouble clicking on checkbox witch is situated on every single row in the left column. User can click on every cell in the row he wants and checkbox will became checked or unchcked..  </p>

<p>But I'm not able to simulate this click into table cell. First I'm trying to get some cell into variable and then to click on this cell using this variable like this:</p>

<pre><code>    Page Should Contain Element     xpath=//div[contains(@id,'-tableCtrlCnt')]
    ${item1}    Get Table Cell  xpath=//div[contains(@id,'-tableCtrlCnt')]/table/tbody  1   2
    Click Element   ${item1}
</code></pre>

<p>But I'm getting error on the second line of code, I just cannot get the column.<br>
The error/fail is:</p>

<blockquote>
  <p>Cell in table xpath=//div[contains(@id,'-tableCtrlCnt')]/table/tbody
  in row #2 and column #2 could not be found.</p>
</blockquote>

<p>And this is how part of my html code looks like:</p>

<pre><code>&lt;div id="__table1-tableCtrlCnt" class="sapUiTableCtrlCnt" style="height: 160px;"&gt;
&lt;table id="__table1-table" role="presentation" data-sap-ui-table-acc-covered="overlay,nodata" class="sapUiTableCtrl sapUiTableCtrlRowScroll sapUiTableCtrlScroll" style="min-width:648px"&gt;
&lt;tbody&gt;
&lt;tr id="__table1-rows-row0" data-sap-ui="__table1-rows-row0" class="sapUiTableRowEven sapUiTableTr" data-sap-ui-rowindex="0" role="row" title="Click to select or press SHIFT and click to select a range" style="height: 32px;"&gt;
&lt;td role="rowheader" aria-labelledby="__table1-ariarowheaderlabel" headers="__table1-colsel" aria-owns="__table1-rowsel0"&gt;&lt;/td&gt;
&lt;td id="__table1-rows-row0-col0" tabindex="-1" role="gridcell" headers="__table1_col0" aria-labelledby="__table1-0" style="text-align:left" class="sapUiTableTd sapUiTableTdFirst"&gt;
  &lt;div class="sapUiTableCell"&gt;
  &lt;span id="__text37-col0-row0" data-sap-ui="__text37-col0-row0" title="1010"   class="sapMText sapMTextMaxWidth sapMTextNoWrap sapUiSelectable" style="text-align:left"&gt;1010
  &lt;/span&gt;
  &lt;/div&gt;
&lt;/td&gt;
&lt;td id="__table1-rows-row0-col1" tabindex="-1" role="gridcell" headers="__table1_col1" aria-labelledby="__table1-1" style="text-align:left" class="sapUiTableTd"&gt;
  &lt;div class="sapUiTableCell"&gt;
  &lt;span id="__text38-col1-row0" data-sap-ui="__text38-col1-row0" title="Company Code 1010" class="sapMText sapMTextMaxWidth sapMTextNoWrap sapUiSelectable" style="text-align:left"&gt;Company Code 1010
  &lt;/span&gt;
  &lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
...
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
</code></pre>

<p>Don't you have any idea how to solve this click into table issue?</p>

<p>Check whether this helps you-</p>

<pre><code>${item1}    Get Table Cell  xpath=//table[contains(@id,'__table1-table')]  1   2
</code></pre>

<p><strong>OR</strong></p>

<p>${item1} =    Get Text  //table[contains(@id,'__table1-table')]//tr[1]//td[2]//div/span</p>

python testing automated-tests pycharm robotframework