我相信你必须:
- 存储您将要进行多少次邀请的值
- 存储预期人数的值(即当前加上邀请)
- 去做邀请
- 为新的总人数存储一个值
- 将新数字与预期数字进行比较
下面对数字进行捕获和比较。您只需添加执行实际邀请的部分。
<tr>
<td>store</td>
<td>5</td>
<td>people_invited</td>
</tr>
<tr>
<td>storeText</td>
<td>//div[contains(text(),'Total number of people')]</td>
<td>original_count_text</td>
</tr>
<tr>
<td>storeEval</td>
<td>parseInt(storedVars['original_count_text'].match(/\d+/))+parseInt(storedVars['people_invited'])</td>
<td>expected_count</td>
</tr>
<tr>
<td>echo</td>
<td>Go invite 5 people</td>
<td></td>
</tr>
<tr>
<td>storeText</td>
<td>//div[contains(text(),'Total number of people')]</td>
<td>new_count_text</td>
</tr>
<tr>
<td>storeEval</td>
<td>parseInt(storedVars['new_count_text'].match(/\d+/))</td>
<td>new_count</td>
</tr>
<tr>
<td>verifyExpression</td>
<td>${expected_count}</td>
<td>${new_count}</td>
</tr>