Is there a way I can run Selenium Webdriver with Ruby bindings test suite and once it is done running, carry on writing tests further in irb?

StackOverflow https://stackoverflow.com/questions/22866056

Question

I am running test suite with Selenium Webdriver and Ruby Bindings. Everytime I have to write script for new functionality I have to run entire code manually in IRB to reach particular level from where I can carry on further with trial and error method for CSS Selector method.

Whole objective for this would be to avoid manually running the script as it is time consuming.

Thanks, Abhishek

Was it helpful?

Solution

If you're using irb, you don't need to run entire code. Instead of executing entire code before the point which you want to check with selector methods, perform those steps manually and then proceed with trial and error for the element you want to check. Of course, you'll have to create browser instance in irb like following:

require 'selenium-webdriver'
driver = Selenium::WebDriver.for :firefox
# here perform manual steps to reach to point where you want to perform trial and error and then try with trial and error
driver.find_element(:css, "css_selector")

EDIT:

If you want to do above through script, please go here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top