How to locate an tag within a webpage using Selenium and Java

前端 未结 4 2076
南笙
南笙 2021-01-26 04:24

I want to locate the image tag in a webpage. The application contains a VIEW ICON. While inspecting the view icon, it is coded as image tag. I am not s

4条回答
  •  醉酒成梦
    2021-01-26 05:02

    You image doesn't have the "user-view-icon" CSS class assigned and XPath doesn't work.

    you could do:

    WebElement image = driver.findElement(By.cssSelector("svg.user-dropdown-icon > image"));
    

提交回复
热议问题