Posts

Advance Level Screenshot capturing using Selenium WebDriver and TestNG Listners

In my opinion, you should avoid the following: using static drivers  (because using static variables is a bad practice) using static methods for taking screenshots  (because using static methods is a bad practice) taking screenshots in the test methods  (because you will duplicate code in lots of tests) taking screenshots in the @After methods  (because you dont need to do this) I prefer to take the screenshots using a TestNG listener as follows. create a class for taking the screenshots Every time you need to take a screenshot, create an object for this class and use the capture method. The capture method will take the screenshot and save it in the screenshots folder. package framework ; import java . io . File ; import java . io . FileOutputStream ; import org . openqa . selenium . OutputType ; import org . openqa . selenium . TakesScreenshot ; import org . openqa . selenium . WebDriver ;   public class Screenshot { private WebDriver driver ;

How to Find Broken Links on Webpage with Selenium WebDriver

Image
As an Automation Tester you get to play with links present on the website. Links are one of the most important part of the webpage. So, it's always important to not leave any broken link on any website. Testing the links manually could be a tough and time taking task. In this post, we'll learn to automate the URL links testing. 1. What is a Broken Link? A broken link is a URL which is not working or not reachable. There are multiple reasons for it's dis-functioning. There are different http error status codes which the browser shows when the link is broken. These error codes have different meanings. Let's take a look at the different http status codes. 200 - It means success, link is working. 404 - It's the most common one, which mean Page not found. 403 - Authorization is required to access the page.  400 - It has different meanings, bad request, bad host, timeout etc. 500 - Internal server error. 2. Why a link broke? A link might not be working due to many reason

Mobile App Testing with Emulators - A Complete Guide

Image
What is an Emulator? An Emulator is an application that emulates real mobile device software, hardware, and operating systems, allowing us to test and debug our application. It is generally provided by the device manufacturer. Mobile emulators are free and provided as a part of SDK with each new OS release. As a developer or a tester, you can configure the emulator to closely resemble the devices on which you plan to deploy your application. The emulator window consists of a device screen on the left and phone controls/keyboard on the right. The device screen initially displays ‘ANDROID‘, and then displays the graphical logo, while the Android platform associated with the AVD is initializing. What is AVD Manager? AVD Manager is a tool to create and manage Android Virtual Devices(AVDs), which define device configuration for the Android Emulator. Before you can actually run an emulator, you need to install the Android SDK on your machine and define an AVD, which defines the ha