Issues with Rails/Capybara and selenium/standalone-chrome on Gitlab CI

321 views
Skip to first unread message

Julian Rubisch

unread,
May 17, 2023, 12:33:58 AM5/17/23
to Selenium Users
Good morning!

I'm in the process of upgrading selenium-webdriver (https://github.com/SeleniumHQ/selenium/tree/trunk/rb) from 3.142.7 -> 4.9.1, (and capybara 3.37.1 -> 3.39.1).

Locally, everything works fine, but in my CI pipeline, I get an ArgumentError:

Can't initialize Selenium::WebDriver::Chrome::Driver with :url

my setup, roughly, is this:

https://gist.github.com/julianrubisch/7a96e4778302c1cb9911b6f9db2cb75f#file-application_system_test_case-rb-L7

Note that it was possible 👆 to pass a hub URL to the chromedriver's options. However, this option has been removed: https://github.com/SeleniumHQ/selenium/blob/trunk/rb/lib/selenium/webdriver/common/local_driver.rb#L24

Now I'm wondering how one is supposed to use selenium/standalone-chrome, without specifying a URL to the remote browser? It seems weird that it's trying to use the "LocalDriver", but I have little experience with the internals of selenium. Has anyone else experienced this?

Thanks for any pointers!

All the best,
Julian

Titus Fortner

unread,
May 17, 2023, 8:25:57 AM5/17/23
to seleniu...@googlegroups.com
Yes, we made things more strict in Ruby. Local drivers use the service class to manage where commands get sent, and remote driver uses url, and neither class accepts the other parameter. 

You want to use the remote webdriver class with a chrome options instance. 

Also, you shouldn't need webdrivers gem to run locally with latest version of Selenium. 



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/a1757eeb-4211-47e4-a154-c9c5e7e883a1n%40googlegroups.com.

Julian Rubisch

unread,
May 19, 2023, 2:41:44 AM5/19/23
to Selenium Users
Thank you, Titus.

I didn’t make myself clear enough, it seems. I understand that using it this way isn’t possible anymore.

The question is - how do I use the remote webdriver class in this scenario (using `driven_by` in Rails - I don’t know how to select the specific driver subclass)

Do you maybe have a hint for me?

Thanks 🙏🏻 

Julian Rubisch

unread,
May 20, 2023, 10:24:32 AM5/20/23
to Selenium Users
Ah, probably register a remote_chrome with

Capybara.register_driver(:remote_chrome)

with the correct options 💡

John Small

unread,
Oct 4, 2023, 12:28:10 AM10/4/23
to Selenium Users
"with the correct options 💡"

Can you expand on that please? What are the correct options? Please provide an example of registering remote_chrome with Capybara including a URL to the remote Selenium hub 

Buragapu Dharmendra

unread,
Oct 4, 2023, 11:20:47 AM10/4/23
to seleniu...@googlegroups.com
Hi Frineds, How to start NPM setup with Js script using Puppet for e2e and Jest for Unit Testing .

Regards,
Dharmendra Buragapu

Reply all
Reply to author
Forward
0 new messages