确认消息错误[错误]未找到元素id = popup_ok

时间:2013-08-02 11:10:19

标签: selenium selenium-ide

我正在测试注册页面,但错误“[error] Element id = popup_ok not found”正在出现而不是确认消息。确认消息永远不会出现在浏览器上,因此我需要在请求命令之前在源代码中添加一些手动代码

 </thead><tbody>
<tr>
<td>open</td>
<td>/portal/Welcome.do</td>
<td></td>
 </tr>
  <tr>
<td>click</td>
<td>id=register</td>
<td></td>
  </tr>
    <tr>
<td>type</td>
<td>css=#registerForm &gt; ul &gt; li.second &gt; input[name=&quot;email&quot;]       </td>
<td>sama@gmail.com</td>
    </tr>
    <tr>
<td>type</td>
<td>css=#registerForm &gt; ul &gt; li.second &gt; input[name=&quot;password&quot;]          </td>
<td>123456</td>
 </tr>
  <tr>
<td>type</td>
<td>name=repassword</td>
<td>123456</td>
  </tr>
<tr>
<td>select</td>
<td>name=role</td>
<td>label=Subscriber</td>
  </tr>
  <tr>
<td>click</td>
<td>name=terms</td>
<td></td>
</tr>
 <tr>
<td>click</td>
<td>link=REGISTER</td>
<td></td>
  </tr>
  <tr>
<td>clickAndWait</td>
<td>id=popup_ok</td>
<td></td>
 </tr>

输出: 执行后,在日志中收到输出

 [info] Executing: |open | /portal/Welcome.do | |
 [info] Executing: |click | link=REGISTER | |
 [info] Executing: |type | css=#registerForm > ul > li.second > input[name="password"]          | 123456 |
     [info] Executing: |type | name=repassword | 123456 |
    [info] Executing: |click | link=REGISTER | |
     [info] Executing: |click | id=popup_ok | |
    [error] Element id=popup_ok not found 

1 个答案:

答案 0 :(得分:0)

尝试更改最后一个

|click | link=REGISTER | |

|clickAndWait | link=REGISTER | |