我正在使用selenium IDE编写测试用例,并尝试提取以下标记的value属性中的内容
<div id="inputcontainer_f-5" class="FGIC" style="max-width:none;"><input type="text" autocomplete="off" name="f-5" id="f-5" class="dummyclass FastEvtFieldFocus" value="TEXT_I_WANT_TO_GET" readonly="readonly" spellcheck="true" tabindex="-1" style="">
</div>我的selenium IDE代码
comment | Target | value
store text | xpath=//input[@id='f-3'] | EXTRATCED_CONTENT
echo | ${EXTRATCED_CONTENT}结果:我得到了空字符串
回显:"“
如果我尝试将xpath更改为xpath=//input[@id='f-3']/@value,则会得到以下错误
storeText on xpath=//input[@id='f-5']/@value with value EXTRATCED_CONTENT Failed:
The result of the xpath expression "//input[@id='f-5']/@value" is: [object Attr]. It should be an element.如何在变量EXTRATCED_CONTENT中提取和存储TEXT_I_WANT_TO_GET并回显它
谢谢Jk
发布于 2019-03-29 01:55:43
在下面尝试一下。
//input[@id='f-3']@valuehttps://stackoverflow.com/questions/55402764
复制相似问题