zoukankan      html  css  js  c++  java
  • Watir: Watir webdriver对JS 弹出框的操作现在非常简单。

    以下代码支持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
    
  • 相关阅读:
    顺序容器
    forward_list
    array
    第十一章 关联容器
    C++数组
    C++标准库算法
    第十章 泛型算法
    第九章 顺序容器
    操作系统概述
    文件输入输出
  • 原文地址:https://www.cnblogs.com/autotest/p/3262505.html
Copyright © 2011-2022 走看看