DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report

Using Portable Firefox 46 With Webdriver

Need to use the portable version of Firefox 46 with webdriver? Alan Richardson gives you a code snippet to use to get it working without using Marionette!

Alan Richardson user avatar by
Alan Richardson
·
Jun. 21, 16 · Code Snippet
Like (2)
Save
Tweet
Share
7.65K Views

Join the DZone community and get the full member experience.

Join For Free

as mentioned on david burns’ blog and in a previous post firefox are moving towards marionette driver. at the time of writing firefox 47 doesn’t work with firefoxdriver and you need to use marionette. this may change back soon, and david’s blog post might no longer be available.

as mentioned on the above posts you can use marionette, or use the esr.

or you could use a portable version of firefox.

rather than try and toggle multiple versions of firefox. i downloaded a portable version of firefox. i used a version distributed by portableapps.com . having a portable app means i can run 46 and 47 at the same time and don’t have to uninstall 47 to use 46. the portable app puts all its dlls in the app folder and doesn’t really ‘install’ it mostly un-archives itself.

on the sourceforge site for portableapps they have a set of older firefox versions:

  • portable firefox editions

i downloaded a version of firefox 46.0.1

i extracted/installed this to my ‘tools’ folder which is a peer of my ‘code’ folder:

  • code
  • tools
    • chromedriver
    • marionette
    • iedriver_64
    • etc.

and now i have a firefoxportable folder in my tools folder.

when i instantiate a firefoxdriver i no longer write:

webdriver firefox = new firefoxdriver();


because that would trigger the “firefox is no longer working” error.

instead, i tell the firefoxdriver which executable to use:

firefoxprofile profile = new firefoxprofile();
firefox = new firefoxdriver(
                 new firefoxbinary(
                     new file(system.getproperty("user.dir")+
                     "/../tools/firefoxportable/firefoxportable.exe")
                  ), 
               profile);



and then i can run my @test code as normal without having to use marionette.

obviously, you can abstract this instantiation into a class so you don’t have to change code everywhere.

app POST (HTTP) Blog Driver (software) DAVID Executable

Published at DZone with permission of Alan Richardson, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Implementing PEG in Java
  • Seamless Integration of Azure Functions With SQL Server: A Developer's Perspective
  • What Is the Temporal Dead Zone In JavaScript?
  • A Beginner’s Guide To Styling CSS Forms

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: