Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
浏览器在Ruby脚本失败之前打开然后关闭_Ruby_Google Chrome_Browser_Watir - Fatal编程技术网

浏览器在Ruby脚本失败之前打开然后关闭

浏览器在Ruby脚本失败之前打开然后关闭,ruby,google-chrome,browser,watir,Ruby,Google Chrome,Browser,Watir,所有ruby测试脚本都有这个问题 一旦浏览器打开,它将在22秒后关闭,并在其余测试脚本运行之前关闭。下面是在b=Watir::Browser.new:chrome之后失败的函数。3周前,所有脚本都运行正常。现在没有人会提前通过b=Watir::Browser.new:chrome def startBrowser time0 = Time.new b = Watir::Browser.new :chrome b.goto "https://test.mtc.byu.edu/asses

所有ruby测试脚本都有这个问题

一旦浏览器打开,它将在22秒后关闭,并在其余测试脚本运行之前关闭。下面是在
b=Watir::Browser.new:chrome
之后失败的函数。3周前,所有脚本都运行正常。现在没有人会提前通过
b=Watir::Browser.new:chrome

def startBrowser

time0 = Time.new
  b = Watir::Browser.new :chrome

  b.goto "https://test.mtc.byu.edu/assessmenttools/"

  if browser.title == "Assessment Tools"
    puts "Assessment Tools".yellow
    return browser
  else
    browser.close()
    return nil
  end
end

我猜chromedriver和/或selenium webdriver的版本与新版本的Chrome不兼容

尝试:

  • ,目前为2.9
  • 将selenium webdriver更新至最新版本,当前版本为2.39.0-
    gem安装selenium webdriver

  • 它似乎和我的一样

    这是由于子进程问题()