How to set up Selenium WebDriver working with selenium-webdriver gemstone

Surprisingly, I could not find the first setup guide for Selenium WebDriver working with gemelium-webdriver through Google University. I suppose the stone needs to know where I store all of these jar files to get started. How can I customize this?

+5
source share
2 answers

You must install gem selenium-webdriver first:

gem install selenium-webdriver

Then you can run the ruby ​​program:

#You need to require the gem "selenium-driver" require "selenium-webdriver" #... see webdriver ruby api docs here: http://selenium.googlecode.com/svn/trunk/docs/api/rb/_index.html #... Most usefull classes are Driver and Element, check them out for a good start driver = Selenium::WebDriver.for :firefox driver.navigate.to "http://www.google.com" element = driver.find_element(:name, 'q') element.send_keys "Hello WebDriver!" element.submit puts driver.title driver.quit 

You can find additional information:

about webdriver and ruby ​​(all of the above was an attempt to generalize it)

About Ruby API

As you can see right away, the Webdriver API itself has a different “style” of regular selenium ruby ​​programs ... If you want to use the webdriver and still continue to program using the Selenium-API, you should probably Chechen Selenium2.0 Remote Server , since it seems that he will use Webdriver in a transparent way, while maintaining the same famous Selenium ruby ​​Api

If I am mistaken in some part of the information, please correct me and we will clarify everything together :)

PD: The best relationship information found between Selenium and Webdriver was this blog post

+11
source
 System.setProperty("webdriver.gecko.driver", "C:\\Xerox\\geckodriver.exe"); DesiredCapabilities cap=DesiredCapabilities.firefox(); cap.setCapability("marionette", true); driver = new FirefoxDriver(); driver.get(prop.getProperty("url")); 

Here's how you should start your test case.

0
source

Source: https://habr.com/ru/post/1309209/


All Articles