ruby cucumber 在多个浏览器上的测试

ruby cucumber tests on multiple browsers

我正在使用 windows 10 32 位 ruby 版本 233,我面临这些问题 运行 在 ie 11 浏览器和 chrome 上进行测试已经在 firefox 浏览器上 运行 测试(使用页面对象)的浏览器,

ISSUE with IE: Watir::Exception::NoMatchingWindowFoundException: browser window was closed (eval):1:in `process_watir_call'

ISSUE with Chrome: Errno::ECONNREFUSED: Failed to open TCP connection to 127.0.0.1:9515 (No connection could be made because the target machine actively refused it. - connect(2) for "127.0.0.1" port 9515)

我为 ie 和 chrome 使用了以下挂钩:

Before do
  case $browser
    when 'mozilla'
      @browser = Watir::Browser.new :firefox
      @browser.window.maximize
    when 'chrome'
      @browser = Watir::Browser.new :chrome, :profile => "default"
    when 'ie'
      @browser = Watir::Browser.new :ie
      # @browser.window.maximize
      # @browser.visible = true
    else
      @browser = Watir::Browser.new :firefox
      @browser.window.maximize
  end

  # @browser = Watir::Browser.new :firefox
  # @browser.window.maximize
  # this file contains test data that needs to be changed if tests are being executed in a different environment
  $test_data = YAML.load_file('features/support/input_data/data/login_information.yml')
  # this file contains base URL that needs to be changed if tests are being executed in a different environment
  FigNewton.load('default.yml')
end

我能够 运行 在 ruby 使用 Watir gem 我的一个单独项目上进行小样本测试。 有什么方法可以让它在现有的 firefox 测试中运行吗?

chrome 的问题已通过使用正确的 chrome 驱动程序版本得到解决,但使用 watir 的 IE 仍然存在问题。

也找到了 IE 的解决方案,它与 Internet 选项安全有关,降低安全级别并取消选中启用保护模式。