Like us on Facebook

LightBlog

October 2, 2018

Automatic download and management of Selenium WebDriver binaries (Driver.exe files)

In this post we will see how to avoid downloading driver.exe file and setpath for browser binary.

As you guys already know in order to use chrome, firefox or edge browsers, first we need to download a binary file (driver.exe) and need to set path which allows Webdriver to handle browsers.



Below is example how to set path:


By adding a small dependency in your POM.xml (Assuming you are using maven project) we can avoid downloading binary files and set path. In addition, we have to check manually when new versions of the binaries are released. WebDriverManager will do this job for us automatically


How it works:

WebDriver Manager actually gets your browser version and download the compatible browser binary by itself to make you run your code without interruption.

So now, rather than setting the browser binaries, you just need to add below line of code and you’re done


The line WebDriverManager.chromedriver().setup(); WebDriverManager does magic for you:

  1. It checks for the latest version of the WebDriver binary.
  2. It downloads the WebDriver binary if it’s not present on your system.
  3. It exports the required WebDriver Java environment variables needed by Selenium
By default downloaded binary files (driver.exe) files will be stored in .m2 folder. By using below commands you can get the downloaded version and path of binary file.


Below is sample code:



Video is available here:


18 comments:

  1. myTectra Placement Portal is a Web based portal brings Potentials Employers and myTectra Candidates on a common platform for placement assistance

    ReplyDelete
    Replies
    1. A IEEE project is an interrelated arrangement of exercises, having a positive beginning and end point and bringing about an interesting result in Engineering Colleges for a particular asset assignment working under a triple limitation - time, cost and execution. Final Year Project Domains for CSE In Engineering Colleges, final year IEEE Project Management requires the utilization of abilities and information to arrange, plan, plan, direct, control, screen, and assess a final year project for cse. The utilization of Project Management to accomplish authoritative objectives has expanded quickly and many engineering colleges have reacted with final year IEEE projects Project Centers in Chennai for CSE to help students in learning these remarkable abilities.



      Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining the authors explore the idea of using Java in Big Data platforms.
      Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai

      Delete
  2. Very informative blog sir. Thank you for the sharing.

    ReplyDelete
  3. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.


    selenium training in electronic city | selenium training in electronic city | Selenium Training in Chennai

    ReplyDelete
  4. Nice blog..! I really loved reading through this article. Thanks for sharing such an amazing post with us and keep blogging...Well written article Thank You for Sharing with Us | project management training in chennai | project management certification online | project management course online |

    ReplyDelete
  5. Thanks for sharing the good information and post more information. Talent flames company is one of the best training and placement companies in Hyderabad. Providing training on Technologies like Java,Sql,Oracle,..,etc with 100% Placement Assistance. Now Interviews going on if you want to attend just visit our website and drop your resume. for more information visit us http://talentflames.com/
    training and placement companies in Hyderabad

    ReplyDelete


  6. افضل شركة نقل عفش من الرياض الى مصر شركة شحن عفش من الرياض لمصر
    افضل شركة نقل عفش بالدمام افضل شركة نقل عفش بالدمام
    افضل شركة نقل عفش بالاحساء افضل شركة نقل عفش بالاحساء
    نقل عفش داخل مكة نقل عفش في مكة

    ReplyDelete
  7. Great Post,really it was very helpful for us.
    Thanks a lot for sharing!
    I found this blog to be very useful!!
    Software testing training in Bangalore

    ReplyDelete
  8. I really enjoyed your blog Thanks for sharing such an informative post.Looking For Some More Stuff.

    shuttering works

    ReplyDelete
  9. I really enjoyed your blog Thanks for sharing such an informative post.Looking For Some More Stuff.

    best seo company in bangalore SSS digital Marketing

    ReplyDelete