Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
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
 Sams Sams
Author Profile Icon Sams
Sams
Arrow right icon
View More author details
Toc

Tests on specific Firefox versions


The Firefox binary lets you run tests on your favorite Firefox versions. In order to do that, perform the following steps:

  1. Install multiple versions of Firefox on your PC (say, FF 26 and FF 28). Make sure that the Mozilla Firefox versions are installed at different path locations using custom installation.

  2. Add the following imports in your test code:

    import java.io.File;
    import org.openqa.selenium.firefox.FirefoxBinary;
    import org.openqa.selenium.firefox.FirefoxDriver;
    import org.openqa.selenium.firefox.FirefoxProfile;
  3. Locate the secondary Firefox executable path in the Firefox binary.

  4. Create a Firefox profile and initialize WebDriver as shown in the following code snippet:

    FirefoxBinary binary = new FirefoxBinary(new File("C://Program Files//Mozilla Firefox26//firefox.exe"));
    FirefoxProfile profile = new FirefoxProfile();
    WebDriver driver = new FirefoxDriver(binary, profile);
  5. For Python bindings, use a similar scenario and add the following code snippet:

    from...
lock icon The rest of the chapter is locked
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 $15.99/month. Cancel anytime
Visually different images