gpt4 book ai didi

java - Selenium - 如何计算表格中的行数?

转载 作者:行者123 更新时间:2023-12-03 23:06:14 24 4
gpt4 key购买 nike

我有一个包含“n”行的表格。我需要统计它们,怎么办?

示例:- 我的表格如下所示。

Type        Balance Date received       Date returned   Payment method  Amount
General Default 10/01/2013 08:53:20 Cash $ 10.00

HTML of my table looks like this. <th> is table title row and <td> are the entries done by the user. Everytime the user add the new entry, the count will increase and display a message "3 found for account 6478 ". where 3 is no of rows in the table.
<fieldset>
<table id="listBalances" class="listTable" width="100%">
<thead>
<tr>
<th>Type</th>
<th>Balance</th>
<th>Date received</th>
<th>Date returned</th>
<th>Payment method</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<tr>
<tr class="alt">
<td>General Deposit</td>
<td>Default for RTB</td>
<td>09/30/2013 06:58:41</td>
<td/>
<td>Cash</td>
<td>$ 5.00</td>

最佳答案

要将行数存储到表中,您可以使用 storeXpathCount

storeXpathCount | id=listBalances | NumberOfRows
echo | ${NumberOfRows}

storeXpathCount 会将行数存储到变量 NumberOfRows 中echo 将返回计数。

关于java - Selenium - 如何计算表格中的行数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19155430/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com