我正在尝试使用selenium IDE来搜索filestube.to,并在xpath中出错。 我使用firebug获取xpath并将其直接粘贴到selenium中并得到以下错误;
[error] Element /html/body/div[1]/div[2]/form/div[1]/input not found
代码:
<tr>
<td>clickAndWait</td>
<td>/html/body/div[1]/div[2]/form/div[1]/input</td>
<td></td>
</tr>
完成输出:
[info] Executing: |open | / | http://www.filestube.to/ |
[info] onXhrStateChange(): xhr.readyState = 1 method = HEAD time = 1408504217417
[info] onXhrStateChange(): xhr.readyState = 2 method = HEAD time = 1408504217693
[info] onXhrStateChange(): xhr.readyState = 4 method = HEAD time = 1408504217694
[info] Executing: |clickAndWait | /html/body/div[1]/div[2]/form/div[1]/input | |
[error] Element /html/body/div[1]/div[2]/form/div[1]/input not found
答案 0 :(得分:0)
它可能是通过javascript加载的,并不会立即出现。
尝试在clickAndWait之前的上一步执行waitForElementPresent或waitForVisible。
答案 1 :(得分:0)
糟糕的用户错误。 而不是手动输入xpath,我使用了ide