Heroku: unable to connect to chromedriver 127.0.0.1:9515 when using Watir/Selenium

后端 未结 4 1774
难免孤独
难免孤独 2021-02-07 10:24

This runs locally (without specifying driver_path), but not on Heroku.

Code:

Selenium::WebDriver::Chrome.driver_path = ENV[         


        
4条回答
  •  南旧
    南旧 (楼主)
    2021-02-07 11:04

    This worked for me. I replaced the line below:

    Selenium::WebDriver::Chrome.driver_path = ENV['GOOGLE_CHROME_SHIM']
    

    for this:

    Selenium::WebDriver::Chrome::Service.driver_path = "/app/.chromedriver/bin/chromedriver"
    

提交回复
热议问题