Skip to main content

Posts

Showing posts with the label Java

PODAM - lightweight tool to auto-fill Java POJOs with data

 A huge pain for SDETs is filling mock data to our automation test. PODAM is one such library that is easy to use, requires little to nothing set up, and auto-fills Java POJOs with data. It initializes a java object tree with random data, but you can also define a strategy or use attributes to decide the values that should be set (this makes it more powerful than other libraries like Java Faker, JFairy, etc.)   Read more here: https://mtedone.github.io/podam/index.html   Quick nice video: https://youtu.be/oaQSb-PxrrI Enjoyed reading this article? Please share the knowledge with your friends and colleagues.

Properties Files in Java with Owner library

When we create an automation test framework, most of us use properties files to get any configuration like URL, credentials, or whatever data you need to change frequently as a configuration.   In this blog, we will discuss how we can easily manage properties files with the Owner Java library makes properties file management very easy, and minimize the code required to handle application configuration through Java properties files. If you are using Maven, things are quite simple, just add the following section to your pom.xml: <dependencies> <dependency>     <groupId>org.aeonbits.owner</groupId>     <artifactId>owner</artifactId>     <version> 1.0.12 </version> </dependency> </dependencies>   Note * At the time of writing this page, the latest version is 1.0.12, but you need to check if there is any newer version here: https://mvnrepository.com/artifact/org.aeonbits.owner/o...

How to Unzip files in Selenium (Java)?

1) Using Java (Lengthy way) : Create a utility and use it:>> import java.io.BufferedOutputStream; import org.openqa.selenium.io.Zip; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream;   public class UnzipUtil {     private static final int BUFFER_SIZE = 4096;     public void unzip (String zipFilePath, String destDirectory) throws IOException {         File destDir = new File(destDirectory);         if (!destDir.exists()) {             destDir.mkdir();         }         ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));         ZipEntry entry = zipIn.getNextEntry();         // to iterates over entries in the zip folder         while (en...

What topics should we cover if we are planning to appear for an SDET Selenium/Java position (Exp 4-9 years)?

Here are the topics that we should prepare if we are planning to appear for an SDET Selenium/Java position (Exp 4-9 years): Iteration in Java Abstract Class Vs Interface Strings in Java Static Usage in Java Exceptions in Java HashMap in Java Java Annotations Master to Build your own XPATH and CSS Implicit, Explicit and Fluent Waits Handling Frames Data-driven testing using Excel JavaScript Executor Logs Generation (Logging infrastructure with Log4j) Advanced Reporting (Extent, Allure, Klov Report Generation) TestNG Framework Design Pattern (Page Object Model, Fluent, Singleton- Any 1 should be fine) Selenium Grid And finally: BDD Using Cucumber  Build Management with Maven and/or Gradle Git, GitHub, etc. Continuous Integration with Jenkins, Azure DevOps, Team City, etc. (Any 1 should be fine)