selenium学习系列--windows窗口处理扩展
2010-07-22 17:32
381 查看
selenium对windows的扩展处理不好,需要通过外部工具进行扩展
下面是通过使用autoit3编写的一个处理外部处理成功,实现如下:
1、先建一个dialog.ini文件,配置信息保存在该ini文件中,如下:
实例
<html>
<head>
<title>处理对话框</title>
<script language= "javascript" type="text/javascript">
function clickbutton(flag)
{
if (flag == 1) alert("测试alter对话框");
if (flag == 2) prompt("测试prompt对话框");
if (flag == 3) confirm('测试confirm对话框', '测试confirm对话框?',"测试结果:");
}
</script>
</head>
<body>
<center>
<H1>watir处理对话框<H1>
<hr>
<table border ="2">
<tr>
<th bgcolor = "#aaaaaa">测试内容</th>
<th bgcolor = "#aaaaaa">操作</th>
</tr>
<tr>
<td>文件上传</td>
<td><input type="file" name="file_field" /></td>
</tr>
<tr>
<td>alter对话框</td>
<td>
<input type="button" name="alterbutton" value="测试alter对话框" onclick = "clickbutton(1);" />
</td>
</tr>
<tr>
<td>prompt对话框</td>
<td>
<input type="button" name="promptbutton" value="测试prompt对话框" onclick = "clickbutton(2);" />
</td>
</tr>
<tr>
<td>confirm对话框 </td>
<td>
<input type="button" name="confirmbutton" value="测试confirm对话框" onclick = "clickbutton(3);" />
</td>
</tr>
<a class="jqTransformCheckbox jqTransformChecked" href=" http://staging.healthcompare.com/Health-Insurance-Quote/Individual-Quote.aspx#" jQuery1256697289107="13"/>
</table>
</center>
</body>
</html>
下面是通过使用autoit3编写的一个处理外部处理成功,实现如下:
1、先建一个dialog.ini文件,配置信息保存在该ini文件中,如下:
实例
<html>
<head>
<title>处理对话框</title>
<script language= "javascript" type="text/javascript">
function clickbutton(flag)
{
if (flag == 1) alert("测试alter对话框");
if (flag == 2) prompt("测试prompt对话框");
if (flag == 3) confirm('测试confirm对话框', '测试confirm对话框?',"测试结果:");
}
</script>
</head>
<body>
<center>
<H1>watir处理对话框<H1>
<hr>
<table border ="2">
<tr>
<th bgcolor = "#aaaaaa">测试内容</th>
<th bgcolor = "#aaaaaa">操作</th>
</tr>
<tr>
<td>文件上传</td>
<td><input type="file" name="file_field" /></td>
</tr>
<tr>
<td>alter对话框</td>
<td>
<input type="button" name="alterbutton" value="测试alter对话框" onclick = "clickbutton(1);" />
</td>
</tr>
<tr>
<td>prompt对话框</td>
<td>
<input type="button" name="promptbutton" value="测试prompt对话框" onclick = "clickbutton(2);" />
</td>
</tr>
<tr>
<td>confirm对话框 </td>
<td>
<input type="button" name="confirmbutton" value="测试confirm对话框" onclick = "clickbutton(3);" />
</td>
</tr>
<a class="jqTransformCheckbox jqTransformChecked" href=" http://staging.healthcompare.com/Health-Insurance-Quote/Individual-Quote.aspx#" jQuery1256697289107="13"/>
</table>
</center>
</body>
</html>
相关文章推荐
- C#编译器优化那点事 c# 如果一个对象的值为null,那么它调用扩展方法时为甚么不报错 webAPI 控制器(Controller)太多怎么办? .NET MVC项目设置包含Areas中的页面为默认启动页 (五)Net Core使用静态文件 学习ASP.NET Core Razor 编程系列八——并发处理
- watir学习系列--调用AutoItX操作windows窗口
- python selenium处理windows窗口
- selenium(webdriver)学习笔记5--处理windows security dialog,安全验证
- SELENIUM 处理WINDOWS 上传 窗口
- 【selenium webdriver】处理Windows弹出窗口(window handles)
- php基础系列:从用户登录处理程序学习mysql扩展基本操作
- Selenium 处理windows 上传 窗口
- php基础系列:从用户登录处理程序学习mysql扩展基本操作
- php基础系列:从用户登录处理程序学习mysql扩展基本操作
- struts2系列学习笔记(8)---------------类型转换的错误处理
- Selenium学习笔记之012:处理下拉框
- PHP学习系列(1)——字符串处理函数(3)
- 一站式学习Wireshark(五):TCP窗口与拥塞处理
- MongoDB学习系列8:连接mongodb进行查询处理
- iOS学习系列 - 扩展机制category与associative
- Boost学习系列5-字符串处理
- EXTJS学习系列提高篇:第二十一篇(转载)作者殷良胜,ext2.2打造全新功能grid系列--grid扩展行篇
- [16]Windows PowerShell DSC学习系列---基于Class风格定制DSC资源?
- [4]Selenium学习系列----登录CSDN并为第一篇置顶文章加上评论!!!