Web Automation Setup Guide

Prerequisites:

  • IntelliJ for IDE (Any IDE can be used)
  • JDK Installation and setting up environment variables
  • Maven for dependencies
  • Settings.xml configuration (In case you are using or accessing private repositories)

Installation (Ubuntu)

  1. IntelliJ can be downloaded either using `Ubuntu Software` by searching IntelliJ

Or another way to install IntelliJ is using snap via terminal.
https://linuxconfig.org/how-to-install-intellij-idea-on-ubuntu-20-04-linux-desktop

2. JDK can be installed in ubuntu via terminal
https://docs.datastax.com/en/jdk-install/doc/jdk-install/installOpenJdkDeb.html

Check JDK installation path using below command
- whereis java
Copy this command and paste in a bashrc file. Command mentioned below

export JAVA_HOME=/usr/lib/jvm/java-version
export PATH=$PATH:$JAVA_HOME/bin

Note:
Bashrc file can be viewed directly on terminal using below command
cat ~/.bashrc

If bashrc not exists, you can create new and paste above content using:
sudo vim ~/.bashrc

3. Maven can be configured in ubuntu using terminal commands
https://linuxize.com/post/how-to-install-apache-maven-on-ubuntu-18-04/

Once installed, you can check using the below command.

4. In case you are using external jar files/configuration in projects, you need to paste settings.xml file in Maven’s .m2 repository.

Check the directory path of settings.xml and paste using cp command
cp /usr/local/bin/apache-maven-2.2.1/conf/settings.xml .m2/

Once copied, check using list command in ubuntu to verify settings.xml resides under .m2

Congrats! The configuration is done.

Step # 02

  • Clone the project’s repository:
    https://bitbucket.org/domain/project/src/master

Make sure you have rights to access the correct repository.

  • Create a new folder under Documents, open in terminal and paste above copied URL in terminal.
  • Enter credentials and it gets cloned into your system.
  • Open IntelliJ IDE
  • Open project using open and select pom.xml file and open as project
  • Once the project opens, it will start refreshing Maven to update dependencies, it will take a few min to resolve all dependencies. As soon as it refreshes the project, dependencies will show up in the right panel under the dependencies folder.
  • Build the project to see everything loads and run any test.

BDD Framework

Few extra configurations required for Cucumber BDD framework other than above mentioned steps.

  1. Install Gherkin plugin
  2. Install Cucumber plugin
  3. Check Enable annotation processing under annotations from settings

Rebuild project and run any test. It will configure everything.

Software Engineer, Automation Specialist, Love technology & traveling