Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Selenium Essentials

You're reading from   Selenium Essentials Get to grips with automated web testing with the amazing power of Selenium WebDriver

Arrow left icon
Product type Paperback
Published in Mar 2015
Publisher
ISBN-13 9781784394332
Length 194 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Prashanth Sams Prashanth Sams
Author Profile Icon Prashanth Sams
Prashanth Sams
Arrow right icon
View More author details
Toc

WebDriver playback

The WebDriver playback feature in Selenium IDE lets you run tests in any one of the most popular web browsers: Chrome, Firefox, HtmlUnit, Internet Explorer, and Opera. By default, the WebDriver playback feature is turned off and is inactive. To run Selenium IDE scripts through WebDriver, turn on the WebDriver playback settings.

Launch the Selenium IDE and choose Selenium IDE Options from the Options menu. Switch to the WebDriver tab and select the Enable WebDriver checkbox. Now, restart the Selenium IDE to enable the WebDriver playback feature. However, on changing the browser name, restarting the IDE is not necessary. The idea discussed in these two paragraphs is shown in the following screenshot:

WebDriver playback

Prerequisites for the WebDriver playback feature

The following are the prerequisites that need to be fulfilled to enable the WebDriver playback feature:

  • Download the latest Selenium Server standalone library (JAR) file
  • Install Java to start the Selenium Server
  • Download the latest drivers for popular browsers (chromedriver, IEDriver, and so on)

Selenium Server can be initialized manually from the terminal or Command Prompt. Open the terminal or Command Prompt, locate the Selenium Server JAR file, and run the command using the following syntax:

java -jar selenium-server-standalone-<version-number>.jar

Now you can run the command:

java -jar selenium-server-standalone-2.44.0.jar
Prerequisites for the WebDriver playback feature

Click on the Selenium IDE Play Prerequisites for the WebDriver playback feature button to drive tests through WebDriver. To run tests in the Chrome web browser, replace the text firefox with chrome under the Selenium IDE options, as shown in the following screenshot:

Prerequisites for the WebDriver playback feature

By default, it is essential to set the ChromeDriver path in your working machine. Download the latest ChromeDriver extension from http://chromedriver.storage.googleapis.com/index.html?path=2.9/.

Follow these configuration steps to set the ChromeDriver extension path for different platforms.

On Windows:

  1. Double-click and open the My Computer window.
  2. Right-click anywhere on the window and select Properties.
  3. Click on Advanced System settings.
  4. Click on Environment Variables from System Properties.
  5. Under System variables, select the variable named Path and click on the Edit button.
  6. Now, extract the downloaded ChromeDriver package and copy the location path.
  7. Paste the extracted location in Path (under System variables) and click on OK.

On Linux:

Open the terminal and run the following command:

$ wget http://chromedriver.storage.googleapis.com/2.7/chromedriver_linux64.zip
$ Unzip chromedriver_linux64.zip
$ cp chromedriver /usr/local/bin
$ chmod +x /usr/local/bin/chromedriver

On Mac:

  1. Unzip/extract the zipped package (chromedriver_mac32.zip).
  2. Copy and paste ChromeDriver to /usr/bin.
  3. It will prompt you to enter the admin password; enter it to set the path.
You have been reading a chapter from
Selenium Essentials
Published in: Mar 2015
Publisher:
ISBN-13: 9781784394332
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime