A selenium webdriver exception

后端 未结 5 1269
萌比男神i
萌比男神i 2021-02-04 07:17

Today, when i use the selenium webdrive, i got an error. my platform is mac osx . this is my exception log.

ruby-1.9.2-p0 > Selenium::WebDriver.for :firefox
         


        
5条回答
  •  臣服心动
    2021-02-04 07:36

    I've been using cucumber + capybara + webdriver + parallel_tests, & i've encountered the mentioned error. To resolve the issue, i added the following to features/support/env.rb:

    unless (env_no = ENV['TEST_ENV_NUMBER'].to_i).zero?
      # Standard, which is described at the parallel_tests github page
      Capybara.server_port = 8888 + env_no
    
      # This successfully avoids locking port error, may require less, but
      # on my 8 cores vm, this works like a charm
      sleep env_no * 10
    end
    

    U probably need to adapt the above to fit what u use, the idea is just to force a sleep time to avoid starting all firefox instances at abt the same time, where a wait of 45secs may not be enough.

提交回复
热议问题