4 things to know before starting Selenium automation testing

selenium automation testing

Today’s article will share with you the things to keep in mind before starting Selenium automation testing. Let’s check it out !

Learn about Locator using in Selenium automation testing

Element locators are an important factor in determining the stability of an selenium automation testing script. Many new guys often don’t care much about getting the locator efficiently, but just let it run at that moment.

However, just because an XPath works right away doesn’t mean it will work fine later. Especially when there is a small change on the application and affects the structure of XPath.

Investing time to learn about locator, about supported locator types, relative – absolute XPath & optimal XPath will help a lot and also reduce the time to revise later.

Finding and fixing XPath in particular or locator in general is a tedious and time consuming job.

Preparation test data

The preparation of test data (also known as the Pre-Conditions step) is also an important thing. Most of the script errors are caused by the locator, the rest is about test data. Many of tester often use available data for testing and do not prepare data themself.

For example, when testing the search function, randomly select a product name to search. However, this way is only temporary and carries many risks, because after a while the product name is changed, deleted by another person, and then the script will not find the product and return the result fail.

Creating a data for testing will help us control the condition and ensure that we always have the right data, for example, in the scenario above, instead of randomly choosing a product name, creating a new product in advance to get the necessary data.

Test data recovery in selenium automation testing

Recovery of test data (Post-Conditions) is as important as preparation, for example, after performing a test case to change the password of an account successfully, we must take a step to restore the old value. so that other tests that use the account (or that data in general) are not affected, similar to changing the permissions and status of the data to be tested.

There are some ways to restore data after running selenium automation testing script : Use API after test, run query SQL after test, use UI for restore, snapshot and restore DB..

Dependencies between test cases

The tests should not depend on each other, or in other words it should be independent.

For example, I have 3 testcases, then these 3 testcases should be independent of each other, if only one of the three is taken out, it will still be able to run, avoiding that the tests depend on each other and when running separately, the error is incorrect. If there is a constraint, it should be prepared as a precondition.

Dependencies lead to problems if one test fails, affects other tests behind.


The post today share with you 4 things to keep in mind in the beginning phase with Selenium automation testing, it may take a bit more time to learn but it is worth it and helps a lot especially when you will be involved in a project. Thank you for watching.

Leave a Reply

Your email address will not be published. Required fields are marked *

Understanding Shift-Left Testing: Elevating Software Quality

In the realm of software development, Shift-Left Testing stands as a pivotal strategy, reshaping the traditional approach by bringing testing activities to the forefront of the development lifecycle. By integrating testing early on, this approach effectively enhances the overall quality of the final product. Unlike the conventional sequence where testing trails requirements analysis, design, and […]


Browser Automation: The Ultimate Guide

Browser automation has become a vital aspect of modern-day web development and testing. As technology advances, the demand for efficient and effective ways to automate web browsers increases. This has led to the development of various tools and techniques. In this guide, we will explore the world of browser automation, its importance, and the tools […]

automation engineer

Selenium Automation: Streamlining Your Software Testing Processes

In the world of software development, testing is an essential component of the process. Testing ensures that the software application is working as intended and is free from errors and bugs that could compromise its functionality. This is where automation testing comes into play, and one of the most popular automation tools in the market […]