小编jqu*_*oob的帖子

如何正确使用XPath previous-sibling

我正在使用Selenium IDE为我的网站编写测试,我在使用previous-sibling点击按钮时遇到了麻烦

<td>
<div class="btn-group">
<button class="btn btn btn-danger block" title="Warning, Delete" name="delete" type="button">
<button class="btn btn btn-default block" title="View History" name="history" type="button">
<button class="btn btn btn-default block" title="View Settings" name="settings" type="button">
<button class="btn btn btn-default block" name="device" type="button">
<span class="glyphicon glyphicon-pencil"/>
 Arcade Reader
</button>
</div>
</td>
Run Code Online (Sandbox Code Playgroud)

我自己的路

xpath=//button[contains(.,'Arcade Reader')]/../preceding-sibling::button[@name='settings']
Run Code Online (Sandbox Code Playgroud)

selenium xpath selenium-ide

38
推荐指数
1
解决办法
15万
查看次数

标签 统计

selenium ×1

selenium-ide ×1

xpath ×1