如何解决如何通过使用chrome中的相对xpath提取<td title>中的值“ Data”进行硒测试
能帮我找到td部分的相对xpath
<div class="abc" style="height: 24px; width: 172px; overflow: hidden; border-radius: 7px 7px 0px 0px; cursor: pointer; background-color: rgb(43,136,164);">
<table class="Text" style="line-height: 1.3; width: 100%; height: 100%; table-layout: fixed;">
<tbody>
<tr>
<td title="" style="overflow-wrap: break-word; font-weight: bold; text-align: center; vertical-align: middle; font-family: Calibri; font-size: 12pt; font-style: normal; text-decoration: none; padding: 3px; color: rgb(255,255,255);">Data for table</td>
</tr>
</tbody>
</table>
</div>
解决方法
对于您共享的HTML代码,可以在下面使用:
//td[text()='Data for table']
但是我建议您通过以下链接获得更好的理解:
https://www.lambdatest.com/blog/complete-guide-for-using-xpath-in-selenium-with-examples/
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。