Selenium Web Driver is capable of handling multiple browser tabs. Though the requirement to automate workflows that span multiple tabs is one that automation engineers don’t come across all the time, it’s always good to know how it can be done.
Sunday, April 16, 2023
Saturday, April 1, 2023
Selenium Custom Locators
Friday, March 10, 2023
A Comparison of Network Interception capabilities between Cypress and Selenium
To evaluate this capability I went about automating the 3 scenarios found below,
- Intercepting and waiting for a network resource attached to a web page to be received to the client side.
- Intercepting and simulating 400 and 500 errors.
- Intercepting and changing response payloads.
Saturday, February 25, 2023
Abstracting the Test Layer using TestNG
Leaving abstraction out of the test layer can in time lead to duplication of the logic as well as having to spend more time than what is required to script new scenarios. This post will discuss how the test layer can be abstracted and decomposed using TestNG.
High-level Steps
- Start with designing and implementing test cases so that they are atomic
- Encapsulate the test layer by scripting the test steps and adding assertions required to validate the component. Then put a mechanism in place to read the test data from an object that can be passed from one test class to another as required.
- Finally, use the Factory feature in TestNG to compose the larger scripts using the test classes.
- Validate that the dropdown page loads the dropdown and that the values are as expected.
- Validate that the dropdown allows the user to select the option he wants to select.
Test Class 1
Test Class 2
Factory Class
[1] - https://the-internet.herokuapp.com/dropdown
[repo] - https://github.com/handakumbura/SeleniumAutomationEmployerProfile/tree/feature/atomic_test_cases
Monday, January 30, 2023
Portability testing a web application UI with Selenium
Portability testing of web application UI can easily be handled with Selenium. To handle cross browser testing you can implement a driver instantiation pattern like the one shown below,
For cross mobile agent testing, you can use a TestNG data provider to pass in the device types into your test method and repeat the test for as many emulated devices as you would like.
Find the complete project here, https://github.com/handakumbura/SeleniumAutomationEmployerProfile/tree/feature/cross_browser_cross_agent
Tuesday, December 27, 2022
SeleniumUtil is an open source library to help make Selenium+Java automation easier and faster
I’ve been through two tech companies where they’ve had their own test automation frameworks. The last framework that I used was built to handle Web UI, API, and AS400. The framework was built by providing wrappers for common open-source automation components such as Selenium and Rest-assured. It was easy to set up an automation project using the framework, and only a few of us had any real concerns with it. It was the responsibility of the respective development teams to use the framework to automate their products based on a few loose programming guidelines. As the teams go through this exercise, they would build any custom components they might need as they see fit. Some of these components are universally used but were not available in the framework of the respective open-source components OOTB. Components such abstractions for working with HTML tables or custom ExpectedConditions.
When I had some time on my hand I looked around to see if there are any open-source libraries that I can use out there to cut the automation project setup time and I found that there isn’t a lightweight library that can be easily integrated to existing projects. So I started one of my own.
At the moment the library provides a few wrappers for HTML elements such as RadioButton, MultiSelect, and Table. The plan is to implement other useful features such, Wrappers for common JavaScript script snippets, custom ExpectedConditions, and sliders. The library is at version 0.6.5 and it's available on Maven Central[1]. If you’re interested in contributing to the project please follow the instructions here [2][3].
[1] - https://search.maven.org/artifact/io.github.handakumbura/Seleniumutil/0.6.5/jar
[2] - https://docs.google.com/document/d/1Diudxs53eL8QkfYwHpExkusEtpJxF0mDHVrr6XymXYE/edit?usp=sharing
[3] - https://github.com/handakumbura/Seleniumuntil
-
whats covered: creating a custom mediator to invoke shell scripts for ESB 4.8.1. 1) Create a Mediator Project Generate a medi...
-
Why? Similar to identifying test conditions and done as part of the test analysis activity. Better medium to convey the test scope to other ...
-
Selenium supports many different HTML element locator strategies such as CSS, class, ID, and XPath. Xpath in my opinion is provides you with...