如果我通过电子邮件邀请更多人,会如何编写Selenium IDE命令以验证该号码是否存在?
例如,总人数:30 示例1:如果我邀请1个人,我如何验证总人数是31? 示例2:如果我邀请5个人,如何验证总人数是35?
以下是代码:
<div style="color:#777; font-size:1.3em; float:right; margin-top:5px;">
Total number of people:
<span style="color:red;">30</span>
答案 0 :(得分:0)
我相信你必须:
以下是数字的捕获和比较。您只需添加该部分即可进行实际邀请。
<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>