ImageTag exists in the TR?

前端 未结 2 1145
野性不改
野性不改 2021-01-22 19:20

EDIT:

public bool getImage()
{
    IWebElement table = driver.FindElement(By.Id(\"DIV_ID_1\"));

    string name = String.         


        
2条回答
  •  难免孤独
    2021-01-22 19:55

    Using your original XPath, it works fine, executed both in Firefox and Chrome's developer tools and it returns the img. Does it actually return anything or just doesn't return what you'd expect? Does it error saying the element cannot be found?

    This is another way of getting it:

    //td[normalize-space(text())='TEST1']/../descendant::img/@src
    

提交回复
热议问题