操作系统 Windows 7 64、IE 9.0、Ruby200-x64
宝石:
bigdecimal (1.2.0)
bson (1.8.6)
childprocess (0.3.9)
commonwatir (4.0.0)
ffi (1.8.1)
io-console (0.4.2)
json (1.7.7)
mini_portile (0.5.0)
minitest (4.3.2)
multi_json (1.7.3)
psych (2.0.0)
rake (0.9.6)
rdoc (4.0.0)
rubygems-update (2.0.3)
rubyzip (0.9.9)
selenium-webdriver (2.32.1)
test-unit (2.0.0.0)
watir (4.0.2)
watir-webdriver (0.6.4)
websocket (1.0.7)
win32-api (1.4.8)
win32-process (0.7.2)
windows-api (0.4.2)
windows-pr (1.2.2)
代码:
require 'rubygems'
require 'watir-webdriver'
app_url = "https://url"
@username = "ID"
@password = "password"
ch = Watir::Browser.new :ie
puts "Start test - GES Login/Add"
puts "Go to url: " + app_url
ch.goto app_url
sleep 2
我明白了
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.32.1/lib/selenium/w
ebdriver/remote/response.rb:52:in `assert_ok': Modal dialog present (Selenium::W
ebDriver::Error::UnhandledAlertError)
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.32.1/l
ib/selenium/webdriver/remote/response.rb:15:in `initialize'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.32.1/l
ib/selenium/webdriver/remote/http/common.rb:59:in `new'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.32.1/l
ib/selenium/webdriver/remote/http/common.rb:59:in `create_response'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.32.1/l
ib/selenium/webdriver/remote/http/default.rb:66:in `request'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.32.1/l
ib/selenium/webdriver/remote/http/common.rb:40:in `call'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.32.1/l
ib/selenium/webdriver/remote/bridge.rb:619:in `raw_execute'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.32.1/l
ib/selenium/webdriver/remote/bridge.rb:597:in `execute'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.32.1/l
ib/selenium/webdriver/remote/bridge.rb:159:in `getCurrentUrl'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.32.1/l
ib/selenium/webdriver/common/driver.rb:120:in `current_url'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/watir-webdriver-0.6.4/lib/w
atir-webdriver/browser.rb:111:in `url'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/watir-webdriver-0.6.4/lib/w
atir-webdriver/browser.rb:80:in `goto'
from example_login.rb:12:in `<main>'
我已经尝试了所有可以找到的基本身份验证示例,但似乎没有一个能够识别模式对话框。这是一个简单的 Windows 安全弹出窗口,要求输入用户名和密码,并带有 Windows 基本身份验证的确定或取消按钮。
有什么建议么?