Test Automation Framework – Selenium Part 2 The Test Automation Framework and Execution
Part 2 is the follow on from Part 1 of our beginners step by step guide in setting up a basic Test Automation Framework for Web Application Testing.
The Framework was created by the Exactest offshore team and is being successfully implemented by a number of our clients for automated regression testing. When deciding to create this Framework, our primary objective was to give Test Teams a user friendly framework which would easily allow the extension of additional test cases without too much coding knowledge. The framework is structured to give a logical and easily maintainable extendable automation solution.
Follow Part 2 below to download the base Framework and start to execute your first tests. Please make sure that you have already completed Part 1and verified that your tooling is installed and configured correctly.
Test Automation Framework – Software and Tools
- Java JDK – The steps detailed include jdk1.8.0_151 but please use the most recent available
- Apache Maven / Maven – Software Tool used for Build Automation
- Eclipse IDE – Integrated Development Environment for Java
- Chromedriver for Selenium – Extension to Chrome to allow Selenium to interact with the Browser
- Cucumber Plug-In for Eclipse- Allows Testers write Test in English format
- Windows Batch Editor – Used to create Batch Files for executing your tests
Setting up Java on your PC
- Windows Environment
- Download JAVA (according to your system type 64-bit or 32-bit) and install java on your local system.
- Now you must set your environment variables, “Java path” to “JAVA_HOME” and “Java bin path” to “Path”
- Setting the “JAVA_HOME” environment variable
- First open the JDK folder where you have JDK Installed locally
- We have copied this folder location C:\Program Files\Java\jdk1.8.0_151
- Now open the Systems Environment Variable Window on your PC and paste the copied location. (To do this in Windows 10 Open Start Search, Type “env”, choose “Edit the system environment variables”, Click “Environment Variables” button on bottom right of dialog box, Under System Variables click “New”, Enter details as per Screen Shot.
- Setting the “PATH” environment variable
- The Path variable refers to the location of the “bin” folder inside the JDK folder. Open your JDK folder and check that it has “bin” folder in it.
- As per the below screenshot, we have copied this folder location C:\Program Files\Java\jdk1.8.0_151\bin
- Now you have to open system environment variables window on your machine and paste the copied folder location.
After you have set “JAVA_HOME” and “PATH” variables, it’s time to check if the variables are set correctly. Follow the steps given below to check this.
Verifying Java is working correctly on your PC
- Open DOS Command Line
- Run the Command “java -version”
- This should show the java version number. Verify that this version number is same as the latest JDK version
- Visit the Maven official website , download the Maven zip file, for example : apache-maven-3.5.2-bin.zip . Unzip it to the folder you want to install Maven.
- Assuming you unzip to this folder – C:\Program Files\Apache\maven
- Set Maven path to M2_HOME, MAVEN_HOME and bin path to “Path”
- Set M2_HOME environment variable
- Set MAVEN_HOME environment variable
- Set Path environment variable
- Done, now verify Maven is working correctly again using DOS Command Line Type “mvn -version”
Download and Install IDE
- Download Eclipse IDE for java developers from below link according to your windows version ( Eclipse for java developers )
Download and Install Chromedriver for Selenium
- Download and Install Chromedriver for Selenium
Setup Selenium Environment
- Before we run Selenium tests install these plugins:
- 1. Plugin to work with cucumber feature
- 2. Plugin to work with windows batch files
1. Plugin to work with cucumber feature
- Open/Launch Eclipse IDE. If Eclipse has not automatically downloaded the cucumber feature plugin, please follow below steps.
- Help->Eclipse Marketplace…, Search “Natural” or “Cucumber” , Select “Natural” and press install (It will take a few minutes to download plugin)
2. Plugin to work with windows batch files
- Open/Launch Eclipse IDE. If Eclipse has not automatically downloaded the windows batch editor plugin, please follow below steps.
- Help->Eclipse Marketplace…, Search “Batch Editor” and press install(It will take a few minutes to download the plugin) Then Restart Eclipse IDE
Now your environment should be successfully configured and ready to run your first tests. In Part 2 (coming soon) we will provide a base Project file to import into Eclipse so we can begin executing our first Automated Tests.
Exactest is an Independent Software Testing Services company based in Dublin Ireland. We have helped a wide and varied range of clients in successful IT Delivery in areas such as Strategy, Process, Automation, Performance and Acceptance. If you need assistance with your IT Testing capability please Contact Us for a friendly discussion.