如何获取tbody下的计数,在UFT中使用xpath

发布于 2025-01-17 23:23:17 字数 283 浏览 3 评论 0原文

我正在使用uft编写自动化脚本,我想在一个tbody元素下获取计数号(计数多少“ tr”,然后返回结果)

<tbody role="rowgroup">
    <tr _calss="01">
    <tr _calss="02">
    <tr _calss="03">
    <tr _calss="04">
    <tr _calss="05">
</tbody>

如何在uft中写代码?

I am using UFT to write the automation script, I want to to get the count number under one tbody element,(count how many 'tr', and return the result)

<tbody role="rowgroup">
    <tr _calss="01">
    <tr _calss="02">
    <tr _calss="03">
    <tr _calss="04">
    <tr _calss="05">
</tbody>

How to write the code in UFT?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

贱贱哒 2025-01-24 23:23:17

由于目前尚不清楚是否可以有多个tbody,因此可以将其用于第一个。

count((//tbody)[1]/tr)

Since it is unclear if there can be more than one tbody you could use this for the first one.

count((//tbody)[1]/tr)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文