我在Internet Explorer上使用watir很长时间了。我现在正试图让watir-webdriver工作。我在我的路径中安装了IEDriverServer.exe
。
我的本地计算机上运行的网站正在侦听端口80,我试图通过我的watir测试来访问该网站。通常在watir(没有webdriver)下,IE将只是启动并点击我指定的任何URL,例如http://MY-MACHINE-NAME/default.aspx
。但是,当IEDriverServer启动时,它似乎正在侦听一些随机端口,例如5555.因此,IE将在地址栏中启动并显示类似http://localhost:5555/
的内容。之后,我在下面的堆栈跟踪中出现错误。
我认为我对如何使用webdriver在端口80上访问我的网站有一个基本的误解,就像没有它一样。任何提示都将非常受欢迎。
由于
C:\Home\Server\Test\Watir\web>ruby ViewOrgBillingProfiles_test.rb --name test_04_filtering
Started InternetExplorerDriver server (64-bit)
2.31.0.0
Listening on port 5555
C:/DevInstallations/Ruby193/lib/ruby/1.9.1/net/http.rb:762:in `initialize': No connection could be made because the target machine actively refused it. - connec
t(2) (Errno::ECONNREFUSED)
from C:/DevInstallations/Ruby193/lib/ruby/1.9.1/net/http.rb:762:in `open'
from C:/DevInstallations/Ruby193/lib/ruby/1.9.1/net/http.rb:762:in `block in connect'
from C:/DevInstallations/Ruby193/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
from C:/DevInstallations/Ruby193/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
from C:/DevInstallations/Ruby193/lib/ruby/1.9.1/net/http.rb:762:in `connect'
from C:/DevInstallations/Ruby193/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
from C:/DevInstallations/Ruby193/lib/ruby/1.9.1/net/http.rb:744:in `start'
from C:/DevInstallations/Ruby193/lib/ruby/1.9.1/net/http.rb:1284:in `request'
from C:/DevInstallations/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/http/default.rb:82:in `response_for'
from C:/DevInstallations/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/http/default.rb:38:in `request'
from C:/DevInstallations/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
from C:/DevInstallations/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/bridge.rb:598:in `raw_execute'
from C:/DevInstallations/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/bridge.rb:576:in `execute'
from C:/DevInstallations/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/bridge.rb:189:in `quit'
from C:/DevInstallations/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/ie/bridge.rb:59:in `quit'
from C:/DevInstallations/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/common/driver.rb:166:in `quit'
from C:/DevInstallations/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.1/lib/watir-webdriver/browser.rb:87:in `close'
from C:/Home/Server/Test/Watir/shared/setup.rb:1:in `block in <top (required)>'
C:/Home/Server/Test/Watir/shared/setup.rb:45:in `start_ie': undefined method `speed=' for #<Watir::Browser:0x..fdf634488 closed=false> (NoMethodError)
from C:/Home/Server/Test/Watir/shared/setup.rb:106:in `<top (required)>'
from C:/DevInstallations/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from C:/DevInstallations/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from ViewOrgBillingProfiles_test.rb:2:in `<main>'
答案 0 :(得分:0)
关于这一点,但如果您查看C:\Systemtest\Ruby200\lib\ruby\gems\2.0.0\gems\selenium-webdriver-2.47.1\lib\selenium\webdriver\ie\bridge.rb
中的selenium webdriver,您会看到默认端口设置为5555:
module Selenium
module WebDriver
module IE
#
# @api private
#
class Bridge < Remote::Bridge
HOST = Platform.localhost
DEFAULT_PORT = 5555
DEFAULT_TIMEOUT = 30