Posts

Implement Code Re-usability in Selenium Automation Framework

Image
In this post, you will learn kind of coding pattern which is very helpful in maintaining our automation code. This post is written insight to help beginners. We'll learn that instead of writing a linear script, we should create page (action) methods which in general contain actions which we are going to perform on our web software. Let's say, we have a login functionality in our software and we have to automate it. In that case we'll create a method named login and write the commands like, entering username, password and click login in that method. Now we can use that method wherever we need it in other test cases as well. Benefits of using action methods are: Code Re-usability Better maintainability of code Sample Program for Re-Usable Action Methods: package com . techlistic . tute ; import org.junit.Assert ; import org.junit.Test ; import org.openqa.selenium.By ; import org.openqa.selenium.WebDriver ; import org.openqa.selenium.WebElement ; import o

Automate GoDaddy.com Features with Selenium WebDriver

Image
This post contains two assignments that helps you to learn Selenium browser commands. These are the simplest assignments. So, this assignment post is the best suited to start your automation tester journey. 1. Automate Browser Actions on GoDaddy.com If you are a beginner in automation testing and looking forward to writing your first Selenium code, then this post is the best destination for you. This assignment will teach you the basic commands of Selenium Webdriver to perform basic actions like., Launch the browser, maximize the browser window, validate the page title, and close the browser. In this post, you will find very basic step-by-step assignments which will upgrade your understanding of Selenium Webdriver and its commands. 1. Test Case - Open Godaddy.com and maximize the browser window. Steps to Automate:

Mastering Locators in Selenium WebDriver: The Ultimate Guide with Examples

Image
Selenium is a popular open-source tool used for automating web browsers. It allows testers to write scripts in various programming languages such as Java, Python, C#, and Ruby to automate web applications. One of the critical aspects of Selenium automation is identifying web elements on a web page using locators. In this blog, we will discuss locators in Selenium and how to find them. Locators are nothing but a way to locate web elements on a web page. Selenium WebDriver provides a set of locators that can be used to identify web elements on a web page.  1. The various types of locators supported by Selenium WebDriver are: 1. ID Locator: This locator is the most common and efficient way to locate an element on a web page. Each web element on a page should have a unique ID. You can use the ID Locator to find an element using its ID. 2. Name Locator: The Name Locator is another way to locate an element using its name attribute. This is particularly useful when you want to locate m