0

I want to use selenium web driver with java, i know how to install and set the build path, jars and stuff, but i wonder if there is any way that we can use selenium in java without downloading the jar files.

I have tried created a maven project and set up the selenium dependencies.

Adrian Jimenez
  • 979
  • 9
  • 23
  • It did not work with maven? What did not work exactly? BTW: Maven or Gradle still download the jar files. – AndiCover Aug 09 '19 at 14:25
  • thats my question if jar files are always necessary, or is there a way to avoid the process of downloading them and configure on the pc. – Adrian Jimenez Aug 09 '19 at 14:39

1 Answers1

0

Short answer: No, it is not possible to use Selenium without downloading the jar files.

The jar's are Selenium. Therefor you need them to execute anything. Just remove the libraries and you will see that you will get a lot of compilation errors in your project.

Basically you have two options:

  1. As you already mentioned use Maven (or Gradle).

    • It is very easy to upgrade a dependency.
    • Your project is smaller.
    • You will need internet connection.
  2. Add the libraries manually to your project (see this question).

    • You need to take care of upgrading you library manually (replace jar with newer version).
    • The size of your project increases.
    • You don't need internet connection because you already have everything in your project.

I personally would use Gradle.

AndiCover
  • 1,724
  • 3
  • 17
  • 38
  • Thanks for the info, just one more question, i did not download any jar file, the only archive i downloaded was the chromedriver.zip and after setting System.setProperty("webdriver.chrome.driver" , "/Users/hectorjimenez/Desktop/chromedriver"); it worked, i have selenium dependencies in pom file. So i wonder if there is any way to configure that in maven as well, do you know that? – Adrian Jimenez Aug 09 '19 at 15:09
  • You can use the WebDriverManager for this. https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager/3.6.2 – AndiCover Aug 10 '19 at 09:13