Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Selenium Essentials

You're reading from  Selenium Essentials

Product type Book
Published in Mar 2015
Publisher
ISBN-13 9781784394332
Pages 194 pages
Edition 1st Edition
Languages
Author (1):
Prashanth Sams Prashanth Sams
Author Profile Icon Prashanth Sams
Prashanth Sams
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 $19.99/month. Cancel anytime