使用selenium测试showModalDialog模态对话框
上一篇 / 下一篇 2012-05-14 18:22:44 / 个人分类:Selenium
TAG:
- 引用 删除 dian106106 / 2012-05-14 23:59:30
-
package ENSG;
import com.thoughtworks.selenium.SeleneseTestCase;
public class dhptest extends SeleneseTestCase {
public void dhpjunit1() throws Exception {
selenium.open("http://xin.msn.com/?lang=en-sg");
String overrideShowModalDialogJs="if(selenium.browserbot.getCurrentWindow().showModalDialog){";
overrideShowModalDialogJs += "selenium.browserbot.getCurrentWindow().showModalDialog = function( sURL, vArguments, sFeatures)";
overrideShowModalDialogJs +="selenium.browserbot.getCurrentWindow().open(sURL, 'modal', sFeatures);";
overrideShowModalDialogJs += "};}";
//showModalDialog方法进行覆盖
selenium.getEval(overrideShowModalDialogJs);
selenium.click("link=Make MSN my homepage");
selenium.openWindow("","modal");
selenium.waitForPopUp("modal","15000");
selenium.selectWindow("name=modal");
}
}
- 引用 删除 dian106106 / 2012-05-14 21:16:10
-
模态对话框
模态对话框(Modal Dialogue Box,又叫做模式对话框),是指在用户想要对对话框以外的应用程序进行操作时,必须首先对该对话框进行响应。如单击【确定】或【取消】按钮等将该对话框关闭。
- 引用 删除 dian106106 / 2012-05-14 18:25:19
- selenium 中文论坛的帖子
- 引用 删除 dian106106 / 2012-05-14 18:24:44
- http://seleniumcn.cn/read.php?tid=907
标题搜索
日历
|
|||||||||
日 | 一 | 二 | 三 | 四 | 五 | 六 | |||
1 | 2 | 3 | 4 | ||||||
5 | 6 | 7 | 8 | 9 | 10 | 11 | |||
12 | 13 | 14 | 15 | 16 | 17 | 18 | |||
19 | 20 | 21 | 22 | 23 | 24 | 25 | |||
26 | 27 | 28 | 29 | 30 | 31 |
我的存档
数据统计
- 访问量: 74540
- 日志数: 80
- 建立时间: 2012-04-12
- 更新时间: 2013-05-21