简体   繁体   中英

Rails app: @javascript Selenium Cucumber/Capybara tests fail with object Undefined

I recently upgraded my Mac from Sierra to High Sierra. A rails app I work on that has Cucumber tests now fails with a weird error:

Expected [object Undefined] undefined to be a string (Selenium::WebDriver::Error::InvalidArgumentError)

I have tried running these tests on Firefox 56.0.2 (which worked for weeks just fine before the upgrade) and now 57.0.1.

I have seen this error mentioned in a number of places on the web but apparently only for older versions of geckodriver. I am running version 0.19.1. I have verified as best I can that there are no old geckodriver versions sitting around.

The error crops up when trying to run the "fill_in" command of capybara. I was originally running selenium_webdriver 3.4.4 but have also tried 3.6.0 and 3.8.0 (latest version).

The confusing thing is that my officemates have also upgraded to High Sierra, run the same Firefox versions I have tested, use selenium 3.4.4, and the same geckodriver version I am. Their tests pass. So I'm wondering if anyone knows what OTHER setting/app would be involved in this process that could be different between my machine and my officemates. Thanks for any input.

The problem has been found. I had an executable file called geckodriver.sav sitting in /usr/local/bin. It was an older version of geckodriver. In /usr/local/bin there is a link to the up to date geckodriver in my homebrew cellar. If you look at the selenium source code it chooses "geckodriver*" as the file to launch. Apparently this .sav file was being preferred over the link (maybe arbitrarily based on order files are discovered). Moved the .sav files out of /usr/local/bin and my tests are now all passing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM