How to use quit_driver method of Selenium.WebDriver.SpecSupport Package

Best Selenium code snippet using Selenium.WebDriver.SpecSupport.quit_driver

test_environment.rb

Source:test_environment.rb Github

copy

Full Screen

...22 def driver_instance23 @driver_instance ||= new_driver_instance24 end25 def reset_driver!26 quit_driver27 @driver_instance = new_driver_instance28 end29 def quit_driver30 @driver_instance.quit if @driver_instance31 end32 def new_driver_instance33 check_for_previous_error34 create_driver35 end36 def app_server37 @app_server ||= (38 path = File.join(root_folder, "common/src/web")39 s = RackServer.new(path)40 s.start41 s42 )43 end...

Full Screen

Full Screen

spec_helper.rb

Source:spec_helper.rb Github

copy

Full Screen

...25 GlobalTestEnv.remote_server.start26 end27 end28 c.after(:suite) do29 GlobalTestEnv.quit_driver30 end31end32at_exit { GlobalTestEnv.quit }33$stdout.sync = true...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful