Posts

Showing posts from September, 2020

2 utilities which I use for generating Test Data

Using similar test data in automation over a long period of time becomes useless. To make testing more effective, one has to do experiments (testing) with multiple variations else it will lead to a classical pesticide paradox. In my project, I have used 2 libraries that generate random multiple test data and support many languages. https://github.com/Devskiller/jfairy https://github.com/DiUS/java-faker For example, If I am automation a registration flow, then I can generate first name as Faker faker = new Faker(); String firstName = faker.name().firstName(); OR  Fairy fairy = Fairy.create(); Person person = fairy.person(); System.out.println(person.getFirstName());

Create custom locators to find element in WebDriver Java

In order to make our web application under test more testable, we approached dev and asked them to assign a custom attribute (say data-id to all the web components).  The advantage of this approach is that, dev are now free to change any other attribute ( not data -id) as per the business requirement without breaking our UI automation tests. Since data-id is a custom attribute that means, we have to use either By.xpath or By.Css and pass this data-id attribute every time. Or Just imagine an application that has a lot of images with common attribute href.  To efficiently tackle this situation, we can create our own custom locatory strategy by extending it from By Class. To give an example :- import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.SearchContext; import org.openqa.selenium.WebElement; public class ByImageSrc extends By { private final String imageByString; public ByImageSrc (String imageByString) { this...

Book Summary : Explore It - Chapter 1

Image
I always questioned and thought what is the exact definition of exploratory or Adhoc testing? If exploratory testing is systematic? How one can do exploratory testing in a better way?  To answer this,  I have started reading a book called Explore It!  by   Elisabeth Hendrickson I will publish the summary of each of the chapters in form of a mind map The key take away from this chapter are:- 1. Checking and exploratory are different, though both are needed 2. Exploratory begins by asking questions and tries to find the info that can answer these questions