Automation testing: Selenium + Cucumber – Lesson 6 (Advanced verifications)

Automation testing: Selenium + Cucumber – Lesson 6 (Advanced verifications)

Hello friends!

Welcome to lesson #6!

In the previous lesson You learned how to develop simple verification methods, how to decorate them correctly to receive pretty results in case of failures. Today we will review very interesting and very useful topic regarding advanced verifications and how to implement it with Automotion.

So, we used to have the standard verifications, when we verify only that element is displayed or not. But usually we don’t do any validations that elements are aligned properly on the page. Nowadays we have desktop and mobile web application with responsive design. And correct alignment of elements on the page is super important part of business.

Let’s look this example on www.facey.top:

screen-shot-2016-10-23-at-10-50-33

We want to make sure that tabs “TOP”, “NEWEST” and “MY PHOTOS” have correct order and they are aligned properly. And also we need to validate that footer is placed somewhere under top header.

The second thing that we want to verify – that this home page has correct localisation language and the whole text is really in English. Not latino, but really in English.

You will find everything in attached video. Wish You nice watching!

Amazing!

Now we can cover our test suite that require to have some UI/UX and linguistic skills!

In this lesson You’ve learned very interesting things of how to make verification of proper alignment and orders of elements on the page and how to validate that page has correct localisation. Hope this information will help You in Your automation.

Do not miss the next lesson. We will review the implementation of action classes and some advanced usage of Automotion.

Wish You good luck! Have a nice automation!

 

Automation testing: Selenium + Cucumber – Lesson 5 (Base verifications)

Automation testing: Selenium + Cucumber – Lesson 5 (Base verifications)

Hello dear friends!

Welcome to lesson #5!

Today we will review one of the most important part of automation framework – verifications. Obviously that if our tests verify nothing – they are useless. So, this lesson will give You an understanding of how to create classes for verifications and how to customise them to have nice test results.

Some engineers likes to keep verifications in the body of unit tests, some of them would like to keep it in the same class with page objects. I would prefer to create separate package “verifications” and for each of our page object class create appropriate class for verifications.

Sometimes we need to have base class for verification to keep different methods for base verifications in this class.

Each of our verifications methods will return string with error messages if such were detected during verification.

So, let’s start to implement our first verification class.

Have a nice watching of video lesson!

Well, in this lesson You’ve learned how to create verifications, how to manage the readability of results and tests. It is super important part in creation of the framework for automation testing.

In the next lesson I will show You how to work with advanced verifications, when You want to verify language of the web page, or if elements are aligned correctly, etc. This information You will find in my next video.

Thank You for watching my channel.

Have a good automation!

Automation testing: Selenium + Cucumber – Lesson 4 (Page Object)

Automation testing: Selenium + Cucumber – Lesson 4 (Page Object)

Hello friends!

Welcome to lesson 4!

Today we will have a short lesson and I’m gonna show You one of the ways of how to use Page Object (simple example) with Automotion. There are many different approaches in usage of Page Object and it is hard to say what is better and what is less good. We will use Automotion library to define web elements with fluent waiters correctly. The example that will be showed is based on the web-site https://www.facey.top. We will add 5 elements into our HomePage class. There are: Logo, tabs “NEWEST”, “TOP”, “MY” and footer.

First of all we will create new package “pages” in directory “src/main/java”. Correct naming of the packages is not some strict rule, but this is a part of a clean code that is very important for test maintenance. After creating package “pages” let’s create Java class “HomePage”. All next steps and tricks You can find on the video.

Have a nice watching!

So,  huh! You know already how to create new Maven project, add Cucumber scenario, extend scenario, create first steps for Selenium tests, what is pattern Page Object and how to use it. Now You have enough skills to create some simple automation testing solution. But this is only beginning. And in the next lessons You will find much more interesting information about advanced automation testing.

Learn how to create advanced verifications in the next lesson.

Thanks for watching and reading my lessons!

Have a good automation!

Automation testing: Selenium + Cucumber – Lesson 3 (First Selenium test)

Automation testing: Selenium + Cucumber – Lesson 3 (First Selenium test)

Hello friends!

Welcome to lesson 3!

Today we will review how to use Cucumber and Selenium wrapped in Automotion library. You will understand that to automate Your project is super easy.

Automotion is powerful Java library for automation testing that allows us easy start WebDriver without configuration of it. Also this library has many helpful features that will be very useful in the future.

Please, read carefully how to use this library here Automotion. It’s very easy but You need to know some instruction at least.

So, let’s start and to see how it goes!

Firstly, let’s remove not needed scenario that we created in previous lesson to keep our project clean. Also rename our feature file, feature name and scenario name.

We will automate Selenium-Cucumber scenario where we will open web-site

https://www.facey.top and verify that main logo exists.

Before the start be sure that You have installed Firefox and Chrome browsers.

To download the latest Chrome driver visit this web-site:

http://chromedriver.storage.googleapis.com/index.html

Also double check that You have in pom.xml dependency to Automotion library.

All next steps You’ll find in video. Have a nice watching!

Now You now how to create Your first Selenium scenario using Cucumber. It’s really easy, isn’t it?

We’re gonna review how to create and use Page Object in our next lesson. Each of the lessons is very important and helps to understand how everything works. Do not forget to practice.

Thanks for watching my lessons!

Have a good automation!

Automation testing: Selenium + Cucumber – Lesson 1 (First Maven project and Cucumber scenario)

Automation testing: Selenium + Cucumber – Lesson 1 (First Maven project and Cucumber scenario)

Hello friends!

It’s a first lesson from the tutorial of how to create new project for automation testing based on Selenium, Automotion and Cucumber.

Preparation of environment

Before starting creation of a new project You need:

1. Download and install IDEA IntelliJ. Community version will be enough.

2. Download and install Java 1.8 JDK latest version. For Windows – setup Env variables for Java home:

  1. Right click on ‘My Computers’ and open ‘Properties’.
  2. In Windows Vista or Windows 7, go to “Advanced System Settings”. …
  3. Go to ‘Advanced Tab’ and click on Environment Variables button.
  4. Select ‘Path’ under the list of ‘System Variables’, and press Edit and add C:\Program Files\java\jdk{version}\bin after a semicolon.

3. Download and install Maven 3. For Windows – setup Env variables. Detailed description is here:

https://www.mkyong.com/maven/how-to-install-maven-in-windows/

To verify that everything is installed correctly You need:

  • for JAVA: open Terminal and type “java -version”. Output should display version of Java installed on Your computer
  • for Maven – open Terminal and type “mvn” and press enter. You need to see in output some dummy build process.

Installing of additional plugins

After You have installed IDEA IntelliJ You need to install additional plugins for IDEA. There are:

1. Cucumber for Java. This plugin will be required to bind Cucumber feature file (scenarios) with Java code.

2. Pipe Table Formatter. This plugin will be required to format tables in Cucumber scenarios.

How to install plugins: Go to IDEA Settings -> Plugins. Click on “Browse repositories…”. Type plugin name and click on green button “Install”. After installing both plugins You need to restart IDEA to activate the plugins.

Creating new project

Ok, now we are ready to start the creation of our first project.

Please, create new project. If You don’t have any projects in IDEA – run IDEA IntelliJ and click on Create new project like on the picture:

screen-shot-2016-10-15-at-11-21-58

If You have already opened IDEA with some projects – follow steps from this picture:

screen-shot-2016-10-15-at-11-23-59

Please, watch next video with detailed tutorial of how to create Maven project, build Maven pom.xml (configuration file for Maven project) and create first Java classes for test running.

Also how to create first Cucumber scenario and run it successfully.

Have a nice watching!

Now You know how to setup environment for automation testing, how to create Your first Maven project and Cucumber scenario. In the next lesson we will review how to use tables in Cucumber scenarios and what are tags and how to use them.

Thanks for watching us!

Have a good automation!

Advanced usage of Cucumber or Automotion multidriver scenarios

Advanced usage of Cucumber or Automotion multidriver scenarios

Hello guys,

How many times we had a discussion regarding what type of driver is better to use: headless PhantomJSDriver, local WebDriver or RemoteWebdriver.
Now it’s possible to make a configuration of Your project using Cucumber and Automotion library.
Here  is example of Maven project. There are 4 Cucumber feature files that will run the same test scenarios using different drivers: FirefoxDriver, Remote Chrome Driver, Remote Chrome Driver with mobile emulation of iPhone 6 and headless PhantomJSDriver.

Also there is example of how to perform the smart verification that web page has correct language using Automotion.

To run the tests – simply clone the project and run the test_run.sh file.

Thank You for Your attention and as always – have a good testing!