How to get the value of an attribute using XPath

后端 未结 4 1123
陌清茗
陌清茗 2020-12-10 16:27

I have been testing using Selenium WebDriver and I have been looking for an XPath code to get the value of the attribute of an HTML element as part of my regression testing.

4条回答
  •  囚心锁ツ
    2020-12-10 16:46

    Selenium Xpath can only return elements. You should pass javascript function that executes xpaths and returns strings to selenium.

    I'm not sure why they made it this way. Xpath should support returning strings.

提交回复
热议问题