title: Selenium: How do I assert that a certain element is present in a certain cell of a certain table?
body: <p>I have a table on my page which is supposed to contain a certain element. I can identify the table by its name (it has a unique name), and I can also identify the element easily. I would like to assert that the element is present on row <code>r</code>, column <code>c</code> of the table. What is the cleanest way of doing it using Selenium commands?</p>
  
  <p><strong>Remarks:</strong></p>
  
  <ul>
  <li>I don't want to use more than the table name in order to locate it (I don't want all the <code>div\div\table\div\tbody\td\tr[r]\td[c]</code> in the code). </li>
  <li>I'm using Selenium within PHPUnit. Hence, I can use PHP logic for the task, though I don't want any complex logic for such a simple task.</li>
  </ul>
  
  <p><strong>Clarification:</strong> </p>
  
  <p>If the element in the cell is just plain text, then I can retrieve that text like this:</p>
  
  <p><code>$this-&gt;getText("xpath=//table[@name='tableName']//tr[".$r."]//td[".$c."]");</code> (PHP)</p>
  
  <p>But what if the cell has an element which is not just plain text? What if the element is a link (<code>link=anchor</code>) or a button (<code>//button[@type='button']</code>) or an image or something more complex?</p>
  
  <p>I need to assert that an <em>element</em> specified by a locator of that element resides in a given cell.</p>