红宝石黄瓜测试多个浏览器

问题描述 投票:1回答:2

我正在使用Windows 10 32位ruby版本233,我正面临这些问题,在11浏览器上运行测试,并且Chrome浏览器用于已在firefox浏览器上运行的测试(使用页面对象),

ISSUE与IE:Watir :: Exception :: NoMatchingWindowFoundException:浏览器窗口关闭(eval):1:在`process_watir_call'

问题与Chrome:Errno :: ECONNREFUSED:无法打开到127.0.0.1:9515的TCP连接(无法建立连接,因为目标计算机主动拒绝它。 - 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

我能够使用Watir gem在ruby mine的单独项目上进行小样本测试。有没有办法让它适用于现有的firefox测试?

ruby testing cucumber watir rubymine
2个回答
1
投票

chrome的问题已通过使用正确的chromedriver版本修复,但仍然存在使用watir的IE问题。


1
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.