Experiencing slam poetry

Nothing came to my mind when I heard those words, I wondered: what is it going to be about? Are we going to write poems and then read them in the class? And with these questions came almost all the…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




How to setup Selenium Java with Gradle minimum dependencies

Let’s learn how to setup Selenium Java with Gradle minimum dependencies needed.

We will create a new project from scratch using only Gradle Build Tool.

First we need to create a project directory, eg gradle-selenium-java:

Next we need to change directory to the newly created one:

Now we should use Gradle init command to generate a project:

Now we need to answer couple of questions. Choose basic project type:

Choose Groovy to build a DSL script:

Type a project name or use a default option:

Default build.gradle file generated by the Gradle basic init task is empty and should look like this:

To create a Selenium Java build.gradle file with the minimum dependencies we will replace it with the following code:

Test scenario is really simple:

First we should create Java test package directory:

Now we can create our test class file:

And add following Java code:

Please keep in mind that to run the test resources directory should be created:

and chromedriver file should be copied to the resources directory.

To run the test we should use command:

or ./gradlew clean test in case of using Windows.

Successful test output example:

Gradle HTML report could be find in:

Add a comment

Related posts:

What is the basic principle of public finance?

The basic principle of public finance is that the government should raise money to pay for public goods and services in a way that is efficient and equitable. This means that the government should…