【发布时间】:2018-11-08 14:55:48
【问题描述】:
我正在尝试查找匹配的字符串,然后使用 Selenium IDE 单击回复按钮。
我不断收到“未找到”错误。
我试过了:
/html/body/div[2]/article[2]/div[1]/a[3]/span[contains(text(), 'my-search-string')
示例 HTML:
<article class="thread">
<div class="threadline normal first">
<span class="area" title="no location given">---</span>
<a href="?act=Q&ID=291557485" target="R" class="title">text?</a> <
<a href="?act=su&handle=my-search-string" target="R" class="handle">
<span class="handle hnd">my-search-string</span>
</a> >
<button class="BlockButton">Block</button>
<time>12:14</time>
</div> <!-- Added by edit -->
</article> <!-- Added by edit -->
或
<div class="threadline normal">
<span class="dotz"> : . . : . . : . . : . . : . . </span>
<a href="?act=Q&ID=291557031" target="R" class="title">some text</a> <
<a href="?act=su&handle=my-search-string" target="R" class="handle">
<span class="handle hnd">my-search-string</span>
</a> >
<button class="BlockButton">Block</button>
<time>12:03</time>
</div>
我得到错误:
'未找到'
如何使用 Selenium IDE 在表达式中搜索字符串“my-search-string”
<span class="handle hnd">my-search-string</span>
?
【问题讨论】:
标签: xpath selenium-ide