Selenium: How do I assert that a certain element is present in a certain cell of a certain table?

前端 未结 2 461
萌比男神i
萌比男神i 2021-01-18 07:37

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 ea

2条回答
  •  遥遥无期
    2021-01-18 08:35

    You could try Selenium's getXpathCount

    $this->("xpath=//table[@name='tableName']//tr[".$r."]//td[".$c."]//TAG");
    This will return the number of matches the xpath gets. in your case, zero would mean a fail.

提交回复
热议问题