How to find specific lines in a table using Selenium?

前端 未结 6 538
伪装坚强ぢ
伪装坚强ぢ 2021-01-02 09:52

Here is an example code:

So this table being in prod

6条回答
  •  情深已故
    2021-01-02 10:43

    You want:

    int rowNumber=...;
    string value = driver.findElement(By.xpath("//div[@id='productOrderContainer']/table/tbody/tr[" + rowNumber +"]/div[id='something']")).getText();
    

    In other words, locate

    with the id "something" contained within the rowNumberth
of the
contained within the
with the id "productOrderContainer", and then get its text value (which is what I believe you mean by "get me the value in
"

提交回复
热议问题