Srinath
Srinath

Reputation: 1343

Selenium error message

I was getting the below error when running scripts

Problem while capturing system stateundefined local variable or method `selenium_driver' for Spec::Example::ExampleGroup::Subclass_1:0x7f8ad0819298>

here is my settings :

def sel_setup
@verification_errors = []

if $selenium
  @selenium = $selenium
else
  @selenium = Selenium::Client::Driver.new "localhost", 4444, "*firefox", "http://xyz.com", 5000000  
  @selenium.start_new_browser_session  
end
@selenium.set_context("Executing XYZ test cases")

end

def test_stop @selenium.close_current_browser_session end

Could any one please tell me the fix on this issue .

thanks in advance.

Upvotes: 0

Views: 616

Answers (1)

Aaron Tinio
Aaron Tinio

Reputation: 81

The RSpec HTML report formatter that comes with the selenium-client gem needs selenium_driver to point to your instance of Selenium::Client::Driver.

In your case, something like this should work:

def selenium_driver
  @selenium
end

Upvotes: 1

Related Questions