Watir: Watir webdriver对JS 弹出框的操作现在非常简单。
2013-08-16 16:49
218 查看
以下代码支持Firefox,IE,Chrome require 'watir-webdriver' #require "watir-webdriver/extensions/alerts" b = Watir::Browser.new :chrome b.goto("http://192.168.10.110:ab/PersonInfo.aspx") b.text_field(:id, "txtName").set("w3") b.text_field(:id, "txtPwd").set("w3") b.button(:id, "Logininfo").click b.form(:id, "Form1").button(:name, "ctl00$MainContent$ctl00").click b.link(:id, "MainContent_gridview_LinkButton1_0").click if b.alert.present? puts b.alert.text b.alert.ok end browser.alert.ok # Will click OK button on the popup browser.alert.close #Will click Cancel button/close on the popup browser.alert.text #Will return the text on the popup
相关文章推荐
- 毕业设计(十九)---文章模块管理 div弹出层的应用 简单js操作
- 【转】Selenium WebDriver的简单操作说明
- python selenium-webdriver 处理JS弹出对话框
- 【转】Selenium WebDriver的简单操作说明
- WebImageButton 服务器端指定JS方法,操作前弹出询问对话框
- jquery.artwl.thickbox.js 一个非常简单好用的jQuery弹出层插件
- Selenium WebDriver的简单操作说明
- 20171012学习笔记Selenium 2 第四章WebDriver API 4.2控制浏览器 4.3简单元素操作4.4鼠标事件4.5键盘事件
- 【转】Selenium WebDriver的简单操作说明
- WEB应用之:JS className 的简单操作
- WebDriver API(3)简单元素操作
- 前端开发:一款近年非常受欢迎、简单的WEB弹出层组件(layer)
- python selenium-webdriver 处理JS弹出对话框(六)
- WebView的简单使用,附加一点JS交互操作
- java selenium webdriver处理JS操作窗口滚动条
- seleniumWebDriver的API操作杀进程、截屏、执行js脚本_10_4
- python + selenium webdriver 通过python来模拟鼠标、键盘操作,来解决SWFFileUpload调用系统底层弹出框无法定位问题
- webdriver与浏览器_操作页面元素—弹出窗口
- Selenium WebDriver的简单操作说明
- Watir: Watir-WebDriver对打开的浏览器attach操作