Galen Framework is a test automation framework which was originally introduced to perform cross browser layout testing of a web application in a browser. Nowadays, it has become a fully functional testing framework with rich reporting and test management system. This framework supports both Java and Javascript.
3. Galen Framework is a test
automation framework which was
originally introduced to perform
cross browser layout testing of a web
application in a browser. Nowadays,
it has become a fully functional
testing framework with rich
reporting and test management
system. This framework supports
both Java and Javascript.
4. WHAT IS CROSS
BROWSER TESTING
The practice to ensure that the
layout of a website looks and runs
seamlessly across various browsers
is called Cross Browser Layout
Testing. We are living in an era
where responsive design is turning
into a necessity for every website. If
you are looking to address the
following challenges for Responsive
Site Layout in multiple devices for
eg., Mobile, Desktop etc., then Galen
Framework is one of the best open
source framework to choose:
5. In this PPT, we will take a look on how
to set up test automation environment
for Galen Framework with IntelliJ and
then go ahead with the script. I would
also show you how to generate reports
for your automation test cases along
with few troubleshooting tips to help
you in getting started on browser
automation with Galen Framework for
cross browser layout testing.
6. Step1: Setting up the Environment
The only pre-requisite required would
be the installation of JDK 8 in your
machine. For installing JDK 8
(minimum JDK version), visit the
official website to download.
Once the installation is complete, you
would have to provide a set up the path.
Here is how you can do so!
In windows, search for “Environment
Variables” and select “Edit System
Environment Variables”.
7. After that, find “Path” in variable section and
double-click. In variable value, add“
%JAVA_HOME%bin” in the path to make
sure specified version of java is accessible in
the machine
Now, in order to validate if JDK is properly installed or not! Mention the below
command in your cmd(Command Prompt):
java -version
8. IntelliJ is a free, open-source Java
IDE(Integrated Development
Environment) for developing Java-
based computer software. You can
download Community version of
IntelliJ from here.
Step 2 – Download IntelliJ
and Setup Maven Project
9. Click on Create New Project, select Maven and click
‘Next’ button.
10. Enter GroupId, ArtifactId and leave version default and click ‘Next’ button.
Leave the project name and select the location where your project is to be
located. Click on ‘Finish’ button
11. The created project displayed in IntelliJ as below snapshot. Please make sure
to enable auto import.
Add Maven Dependency in IntelliJ by following the steps:
1. Go to Maven repository https://mvnrepository.com/ and search for Galen
framework
12. 2. Select the latest
Galen Framework
Support for Java
Test Framework.
3. Select the latest version which
lists in the top and copy the Galen
Framework dependency which is
highlighted in the below snapshot.
13. Copy the above Maven dependency in pom.xml in your project. Once copied, it’s
dependencies and transient dependencies are downloaded from the Maven
repository. For eg., Dependency like Galen Framework and transient
dependencies like Selenium, along with some common libraries.
14. Understanding of How to write Spec
file:
Galen spec language is quite flexible and
gives you the opportunity to express the
exact manner in which you would want
your website to behave when accessed
through different devices. There are two
main parts in the page spec file: Object
Definitions and Object Specs.
Step 3: Implementing a
Spec File
15. This spec file is important and a pre-requisites to run your automation based on
definition added as expected result, which runs and compare actual result in your
application.
Let me write a simple spec file for the website https://www.lambdatest.com/
To create spec file the extension must be “.gspec”
16. We need to write code for our
automation script to work with
Galen Framework. Before you
start writing code for browser
automation through Galen
framework, you need a directory
for your program. You can create
a directory by going to Java
directory under test. Goto test-
>java directory-> create a
directory name called “testsuites”
and create a new class.
Step 4: Writing Code
17. Here is an example demonstrating browser automation with Galen framework. I
will be writing code in order to verify logo present and pixel for LAMBDATEST
logo and background colour, font-size for the button that says “START TESTING”.
18. Once you run the above code, the report gets generated under target ->galen-
html-reports
Open reports.html which returns the following report
Step 5: Report Generation:
Click on hyperlink label at left side.
19. ● After setup the project, in
case you get any error in
IntelliJ, Please double check
by navigating to Right-click
on Project->Open Module
Settings->Modules->Select
JDK version 1.8
● We should maintain proper
indentation in spec file
otherwise it may throw an
error. Please visit the website
for more details.
Troubleshooting
20. That was all you need to know for getting started with browser automation using
Galen framework to perform cross browser layout testing of your website or web-
app. Let me know your thoughts on this tutorial in the comment section below. I
would appreciate if you have any questions for me or if you share about your
experience with Galen framework for cross browser layout testing has been so far?
Happy testing!
CONCLUSION