Software Cats - Blog

Part 6— Java Autotests for a Site from Scratch. The Code. Connecting Libraries

Starting to write a code and connecting libraries in a POM file.

Let’s open our project in IDEA and review its structure.
Please check the pom.xml file (“POM” stands for Project Object Model). It’s a special XML file in the root folder of your project that contains information about the project, configuration details, libraries, and plugins used by Mavin to create a project.

First, let’s add some info on our project <groupId>package_name</groupId>



Now let’s connect some libraries.

Library is a complete solution that we can use to create our programs.

As a rule, most of the popular libraries are stored in the Maven central repository. There you can find the necessary library and learn how to connect it. By the way, Maven uses the word “dependencies” for libraries.
To add a new dependency, you need to create a new <dependencies></dependencies> block in your POM file.

This block will contain all dependencies, and every dependency should be declared within the <dependency></dependency> tag.

To write UI tests, we’ll need the JUnit, Selenium, and Selenide dependencies.
After adding the dependencies to the POM file in IDEA, you need to upload the changes to Maven. It is recommended to restart IDEA and Maven after adding the new libraries.