您的位置:首页 > 其它

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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐