我想使用selenium来测试我的网络应用程序。
它有效......但是......
对于确认对话框,我重写了方法
function confirm(text,cbk) {
$.prompt(text,{
buttons:{Ok:true, Cancel:false},
opacity: 0.3,
overlayspeed: 'fast',
promptspeed: 'slow',
callback: function(v,m){
if(v){
cbk.call();
}
else{
}
}
});
}
我使用了jquery和插件Impromptu作为确认框的图形。
我用 Selenium IDE 记录我的测试。在我开始测试并且测试失败后。测试是“点击一个链接,应该会出现对话框(即兴风格),然后我想按'OK'键”
这是测试的代码
<!-- login page -->
<tr>
<td>open</td>
<td>/demoit/action/Home</td>
<td></td>
</tr>
<!-- inser the username and the password -->
<tr>
<td>type</td>
<td>user_name</td>
<td>tommaso</td>
</tr>
<tr>
<td>type</td>
<td>pass_word</td>
<td>pwdtommaso</td>
</tr>
<!-- click in the login image that call a script for login -->
<tr>
<td>clickAndWait</td>
<td>css=body > div:nth(2) > p > img</td>
<td></td>
</tr>
<tr>
<td>chooseCancelOnNextConfirmation</td>
<td></td>
<td></td>
</tr>
<!-- click on exit link -->
<tr>
<td>click</td>
<td>css=#mycontentheader > table > tbody > tr:nth(1) > td:nth(1) > table.entrata > tbody > tr > td > a > img</td>
<td></td>
</tr>
<tr>
<td>assertConfirmation</td>
<td>Do you want to exit?</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>jqi_state0_buttonOk</td>
<td></td>
</tr>
那是由Selenium IDE制作的。
问题是什么?
请帮我,
问候,
托马索