【发布时间】:2016-08-23 15:26:41
【问题描述】:
在从 Jenkins 构建后通过调用 rake 任务触发黄瓜测试时,我无法在 CI 服务器(在我的情况下为 Linux 上的本地主机)上启动浏览器。 Jenkins 控制台日志如下。我很确定一切都设置正确,因为我可以通过命令行在服务器上成功运行它。
01:26:43 [cucumber] $ /usr/local/rvm/scripts/gems/ruby-2.3.0/bin/rake schedule_win_job:features --trace
01:26:43 ** Invoke schedule_win_job:features (first_time)
01:26:43 ** Execute schedule_win_job:features
01:26:43 /usr/local/rvm/scripts/rubies/ruby-2.3.0/bin/ruby -S bundle exec cucumber --tag @schedule_job --profile dev
**01:27:45 unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055) (Selenium::WebDriver::Error::WebDriverError)**
01:27:45 /usr/local/rvm/scripts/gems/ruby-2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/firefox/launcher.rb:90:in `connect_until_stable'
01:27:45 /usr/local/rvm/scripts/gems/ruby-2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/firefox/launcher.rb:55:in `block in launch'
01:27:45 /usr/local/rvm/scripts/gems/ruby-2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/common/socket_lock.rb:43:in `locked'
01:27:45 /usr/local/rvm/scripts/gems/ruby-2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/firefox/launcher.rb:51:in `launch'
01:27:45 /usr/local/rvm/scripts/gems/ruby-2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/firefox/bridge.rb:43:in `initialize'
01:27:45 /usr/local/rvm/scripts/gems/ruby-2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/common/driver.rb:53:in `new'
01:27:45 /usr/local/rvm/scripts/gems/ruby-2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/common/driver.rb:53:in `for'
01:27:45 /usr/local/rvm/scripts/gems/ruby-2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver.rb:84:in `for'
01:27:45 /usr/local/rvm/scripts/gems/ruby-2.3.0/gems/watir-webdriver-0.9.1/lib/watir-webdriver/browser.rb:46:in `initialize'
【问题讨论】:
-
与今天早些时候的stackoverflow.com/questions/36917134/… 相同的答案 - 确保您的路径上有 Firefox 45。
-
对不起,我检查了你提到的所有要求,但问题仍然存在。如果我将浏览器更改为 Chrome,我会遇到StackOverflow question 此处报告的新问题,并且那里的解决方案也不适用于我。
-
顺便说一下,如果我尝试通过 Jenkins 使用裸 shell 命令启动 Firefox,以下是我收到的错误消息。
[20:38:21] /usr/bin/firefox [20:38:21] Error: GDK_BACKEND does not match available displays
标签: selenium-webdriver jenkins continuous-integration cucumber watir-webdriver