获取Robotframework中给定元素的HTML标记
假设我的源代码中有以下HTML:获取Robotframework中给定元素的HTML标记,robotframework,selenium2library,Robotframework,Selenium2library,假设我的源代码中有以下HTML: ... <span id=myElement>some text</span> ... 现在,我想获取该定位元素的html标记,如下所示: ... ${tag} Some Keyword To Get the HTML of a located Element ${web_element} Log To Console ${tag} >> "span" ... 如何在Robotframework中获取该元素的HTM
...
<span id=myElement>some text</span>
...
现在,我想获取该定位元素的html标记,如下所示:
...
${tag} Some Keyword To Get the HTML of a located Element ${web_element}
Log To Console ${tag} >> "span"
...
如何在Robotframework中获取该元素的HTML标记?我可以实现一些Python代码,但我不敢相信,现在已经没有其他功能可以获得元素的标记了
谢谢 Web元素有一个
tag\u name
属性,您可以使用robot的
例如:
${web_element} Get Webelement id:myElement
log The tag is ${web_element.tag_name}
${web_element} Get Webelement id:myElement
log The tag is ${web_element.tag_name}