从selenium ide中的元素中选择特定字符
精确:精装版:从selenium ide中的元素中选择特定字符,selenium,selenium-ide,Selenium,Selenium Ide,精确:精装版:$79.99 这是全部要素。我只需要得到值$79.99 商店/精确:精装版:$79.99/i商店评估 /storedVars['i'].搜索($79.99)/结果 我已经尝试过上面的方法,但它不起作用。这里最好的方法是存储完整的元素,然后用正则表达式将其分解 因此,要在这里反映您的示例: <tr> <td>store</td> <td>exact:Hardcover: $79.99</td> <
$79.99
这是全部要素。我只需要得到值$79.99
商店/精确:精装版:$79.99/i商店评估/storedVars['i'].搜索($79.99)/结果
我已经尝试过上面的方法,但它不起作用。这里最好的方法是存储完整的元素,然后用正则表达式将其分解 因此,要在这里反映您的示例:
<tr>
<td>store</td>
<td>exact:Hardcover: $79.99</td>
<td>full</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars['full'].match(/[^: ]+$/)</td>
<td>price</td>
</tr>
<tr>
<td>echo</td>
<td>${price}</td>
<td></td>
</tr>
有关正则表达式如何分解的信息,请参阅
[info] Playing test case Untitled
[info] Executing: |store | exact:Hardcover: $79.99 | full |
[info] Executing: |storeEval | storedVars['full'].match(/[^: ]+$/) | price |
[info] script is: storedVars['full'].match(/[^: ]+$/)
[info] Executing: |echo | ${price} | |
[info] echo: $79.99
[info] Test case passed