Want to fetch value of an attribute in robot framework

主宰稳场 提交于 2019-12-23 05:09:24

问题


I want to fetch the value of aria-expanded from below xpath //div[@id='contact-information']//div[@aria-expanded='false']

Which keyword should I use ?


回答1:


Selenium2Library.Get Element Attribute should do the trick.

http://robotframework.org/Selenium2Library/doc/Selenium2Library.html#Get%20Element%20Attribute

example: Get Element Attribute //div[@id='contact-information']//div[@aria-expanded='false']@aria-expanded




回答2:


You can use the keyword Get Value that returns the value attribute of element identified by locator.



来源:https://stackoverflow.com/questions/38195935/want-to-fetch-value-of-an-attribute-in-robot-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!