Gauge is a free open source test automation framework released by creators of Selenium, ThoughtWorks. Test automation with Gauge framework is used to create readable and maintainable tests with languages of your choice. Users who are looking for integrating continuous testing pipeline into their CI-CD(Continuous Integration and Continuous Delivery) process for supporting faster release cycles. Gauge framework is gaining the popularity as a great test automation framework for performing cross browser testing.
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
How to Perform Test Automation With Gauge & Selenium Framework
1. How To Perform Test Automation With
Gauge & Selenium Framework?
2. What Is Cross Browser Testing?
Cross Browser Testing is the
process to validate the quality of
the web application across
different browsers, browser
versions running on numerous
operating systems to verify
compatibility and behaviour of an
application under test.
3. Why Choose Gauge For Cross Browser Testing Out Of
Other Test Automation Frameworks?
1. Wide range of templates are available in a language of your choice to have
an easy kick start to the project.
2. Command Line support which makes the integration easier with CI-CD
tools.
3. Test automation with Gauge framework supports all major programming
languages along with GoLang.
4. Is Gauge Framework Meant For BDD
● Behaviour Driven Development focuses more on conversations, collaborations and
automation in order to achieve the business needs, test automation with Gauge
framework following Acceptance Test Driven Development focuses and emphasize more
on functional testing.
● Feature file in BDD is replaced by spec file for test automation with Gauge framework.
● Feature file is created with Gherkin Language, Spec file is created using markdown
language.
5. Installing & Setting Up Gauge For Your Operating System
Download the latest build of gauge from GitHub-Gauge. Depending upon the
operating system, download the required binaries.
Installing Gauge Framework in Mac:
Installing Gauge framework in macOS using Homebrew with below commands:
1. brew update
2. brew install gauge.
6. Installing & Setting Up Gauge For Your Operating System
Installing Gauge Framework in Linuxusingapt-get:
1. Add GPG key with below command:
sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --
recv-keys 023EDB0B
2. Add Gauge framework repository to the list.
echo deb https://dl.bintray.com/gauge/gauge-deb nightly main |
sudo tee -a /etc/apt/sources.list
3. Install Gauge framework with below commands:
○ sudo apt-get update
○ sudo apt-get install gauge
7. Using CLI to get started with Project Creation for Gauge
To verify the version of the Gauge framework, open cmd and type command
“gauge --version” as shown in the image below.
8. Using CLI to get started with Project Creation for Gauge
Step 1: Gauge framework has a list of project templates defined already for the
language of your need. You can take a look at it by typing in command “gauge
init --templates”.
9. Using CLI to get started with Project Creation for Gauge
Step 2: Navigate to a folder of your choice and create a java project using
command “gauge init java”.
10. Using CLI to get started with Project Creation for Gauge
Step 3: To run the sample project and view report you can use the command
“gauge run specs”.
11. Creating Your First Project Using Gauge For Test Automation
Start with creating a maven project with
below information.
● Navigate to File and select New
Project.
● Project Type as maven should be
selected.
● You need to select the below
mentioned name:
“com.thoughtworks.gauge.maven:gaug
e-maven-plugin”
This would help you to generate an
archetype.
12. Running First Automation Script Using Gauge
Framework With Selenium Grid
Step 1: Create a specification file for searching a keyword in google and if results are
displayed as expected.
Specification heading in the specs file would be denoted with ‘#’ notation as defined in
our project.
Example: #Google Search Specification
Scenario would be defined using ‘##’ notation, quoting an example below for reference.
Example: ## Searching google should return the name of the query.
13. Running First Automation Script Using Gauge
Framework With Selenium Grid
Step 2: Create a step implementation file, with below-mentioned code to define
acceptance tests as defined in specification files.
14. Running First Automation Script Using Gauge
Framework With Selenium Grid
Step 3: Execute the test case from the specification file created. Right click on
the file and select option as shown in the image below. Browser specification
could be provided in env folder’s default.properties file as
#Browser Usage
BROWSER = CHROME
15. Cross Browser Testing with Parallel Execution using Gauge Framework
Problem Statement:
When it comes to cross browser testing there are more than 6 active browsers usage and
each browser having more than 4 to 5 version of it in use aggressively.
Solution:
1. Local Execution using Selenium-Grid:
You would end up executing 30,000 test cases in total. Manually handling the effort
would be impossible.
2. Cloud Execution using LambdaTest:
Utilizing cloud resources of LambdaTest would drastically cut down the effort as
scalability wouldn’t be an issue.
16. Configuring Our Current Gauge Framework For Test Automation
With LambdaTest
Step 1: Create an account for free on LambdaTest to start cross browser testing
with parallel execution. For a free account, only 1 concurrent user is available,
as more than 1 VM’s need account upgrade. Feel free to look at their pricing
plans over here:
https://accounts.lambdatest.com/billing/plans
17. Step 2: Navigate to “Selenium Desiredcapabilities Generator” tool by
LambdaTest at https://www.lambdatest.com/capabilities-generator/ as shown
in image below.
18. Step 3: Select the required programming language and operating system and browser
configuration as per the requirement, you can enable screenshots and video
recording as well. You have a feature of enabling advance configuration as well, which
lets you define tunnel, console and network logs and time zone selections.
19. Step 4: Copy the code and define the capabilities for remote webdriver in your Step
Implementation file. Code for the same as specified below.
21. Step 5: Execute the specification and observe the terminal for test status.
Step 6: Login to LambdaTest Dashboard, select the automation tab to view your logs of
completed tests. Dashboard view would let you see the analytical information related
to the tests triggered on the LambdaTest.
22. Logs:
Automation logs which are a part of the automation dashboard provides you with
information related to server information, test ID, time stamp of execution in JSON
format.
23. Metadata
Metadata under automation dashboard provides information related to input, meta and
browser configuration as shown in image below.
You can even download the test logs such as screenshots and video recordings, if opted
from this tab.
24. Analytics Dashboard
Analytic view of builds ran, time consumed, build related information of test status such
as pass or fail and bugs logged which can be viewed in both build view and test view.
You can even sort the data using date, user information.
25. Dashboard
Default dashboard view provides you with the overview of how many active concurrent
sessions are running and minutes consumed in execution and the build statuses.
26. To conclude what we have discussed so far, we have kick started our framework
setup of the Gauge framework from scratch and created our first script and
integrated it with LambdaTest to achieve our cross browser testing and parallel
execution goals. Discussed the features and benefits of the tool, importance and the
need of cross browser and parallel test execution along with execution and analysis
of logs in LambdaTest platform.
www.lambdatest.com
CONCLUSION
SCHEDULE DEMO