Welcome to the Question and Answer site for Software Testing Professionals

You can get your queries resolved from Software Testing Professionals.

Ask a Question

Get answers and give answers to questions from other members.

View All Questions

Get votes and earn points to build your reputation in community.

View Hot Questions

System.setProperty("webdriver.gecko.driver", ) vs adding geckodriver to PATH.

Solved 1 Answers 24 Views
0 1
We recently had an argument among my team where we brainstormed on whether to use System.setProperty("webdriver.gecko.driver", "drivers\\geckodriver-v0.18.0-win64.exe"); or setup geckodriver.exe into the PATH.

What is the ideal way?

1 Answer

Best answer
The ideal way is to add gecko driver to PATH variable. This way it will help your code be much more flexible and not dependent on any folder structure.

If you use System.setProperty, you will have to create a folder in your project path and place your driver there. You will even end up adding driver binary file to your repository management system like Git. If you update your driver, the old driver will take up space in your repository. Also, you will have to handle code for Linux and Windows differently.

So, if you simply rely on PATH, the operating system and Selenium library or server will take care of rest of the part.

I suggest you to go with PATH variable.
answered Sep 12, 2017 by SunilBhaskar (445 points)
selected Sep 12, 2017 by stbadmin

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

We have resolved 1.2k+ Software Testing queries!

Software Testing Board Weekly update

We will send you handpicked questions that you would love to answer.

View previous campaigns.

Top Contributors