title: Selenium Robot Framework - Get Table Cell
body: <p>I'm wondering is it possible to <code>click</code> span element, which is located in <code>div</code> element and this <code>div</code> element is situated inside the <code>table cell</code>?</p>
  
  <p>So in the end table looks like this:</p>
  
  <pre><code>&lt;table id="table1"&gt;
    &lt;tbody&gt;
      &lt;tr id="tr1"&gt;
        &lt;td id="td11"&gt;
          &lt;div id="div1"&gt;
            &lt;span id="span1"&gt;TEXT&lt;/span&gt;
          &lt;/div&gt;
        &lt;/td&gt;
        &lt;td id="td12"&gt;
        &lt;/td&gt;
      &lt;tr&gt;
      &lt;tr id="tr2"&gt;
        &lt;td id="tr21"&gt;&lt;/td&gt;
        &lt;td id="tr22"&gt;&lt;/td&gt;
      &lt;tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>And I'm trying to click <code>span</code> element like this:</p>
  
  <pre><code>${table_cell} =   Get Table Cell   xpath=//table[contains(@id,'table1')]/tbody   1   1
  Click Element    ${table_cell}
  </code></pre>
  
  <p>But I'm getting error:</p>
  
  <blockquote>
    <p>stale element reference: element is not attached to the page document</p>
  </blockquote>
  
  <p>So first I added control, if there is this <code>table</code> element and it tells me <b>TRUE</b> every time:</p>
  
  <pre><code>${present} =    Run Keyword And Return Status    Element Should Be Visible    xpath=//table[contains(@id,'table1')]/tbody
  Run Keyword If    ${present}    log to console    \nTABLE CELL ELEMENT EXISTS - ${present}
  </code></pre>
  
  <p>Can you give a advice what am I doing wrong?<br>
  Is there any different behavior if this table is in <code>iframe</code>?</p>