我希望获得下面的代码值,以便在我的测试中使用。
HTML元素:
<code id="user-code">SRQX-FJXQ</code>Xpath:
//*[@id="code"]robotframework的哪个关键字将获得代码值,即SRQX-FJXQ
发布于 2022-08-01 09:33:06
这就是对我有用的东西。必须进行get webelement并将代码转换为文本,如so code.text
*** Variables ***
${auth_code} id=user-code
*** Test Cases ***
${code}= get webelement ${auth_code}
input text ${code_input} ${code.text}发布于 2022-08-09 08:52:37
如果要从特定ID获取文本,可以尝试关键字"Get“http://robotframework.org/Selenium2Library/Selenium2Library.html#Get%20Text
https://stackoverflow.com/questions/73180913
复制相似问题