Search code examples
rubyautomationwatirselenium-grid

How to run selenium grid with ruby watir?


I'm working on Ruby Watir project. Currently, I want to execute test script on Selenium grid. My test script is:

caps = Selenium::WebDriver::Remote::Capabilities.chrome
browser = Watir::Browser.new(:remote, url: '<url>:4444/wd/hub', desired_capabilities: caps)

But I got the error message:

NoMethodError: undefined method `remote' for Selenium::WebDriver::Options:Class

Can anyone to help me resolve this problem. Thanks in advance.


Solution

  • You should be able to use:

    browser = Watir::Browser.new(:chrome, url: '<url>:4444/wd/hub')