Undefined method error using selenium ruby grid


Undefined method error using selenium ruby grid



I am running a basic test to log into a page. When I run this test via a Selenium grid I get:


Failure/error: @driver.navigate.to "https://website.net"
NoMethodError: undefined method 'navigate' for nill:NilClass.



I can confirm the test runs successfully when I run on my local PC without the grid. Do I need to change the method navigate to something else, I can't understand why it won't work when I run it on the grid?


navigate


require "selenium-webdriver"
require "rspec"

#remote capabilities
caps = Selenium::WebDriver::Remote::Capabilities.new
caps['platform'] = 'WIN10'
caps['platformName'] = 'WIN10'
caps['browserName'] = 'chrome'
caps['version'] = '67.0.3396.99'

@driver = Selenium::WebDriver.for(:remote,
:url => 'http://172.16.74.114:4455/wd/hub',
:desired_capabilities => caps)

describe "navigate to website" do
describe "signin to website" do
it "Confirm the user can successfully signin" do

@driver.navigate.to "https://website.net"
puts @driver.manage.window.maximize









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

JMeter fails on beanshell imports

Why in node-red my HTTP POST no receive payload from inject?

PHP contact form sending but not receiving emails