Skip to main content

Posts

Showing posts from August, 2020

TestProject smart and powerful recorder

  TestProject already had a smart recorder that was capable of doing fantastic stuff we look for in any record and playback. It can easily generate source code from recorded tests, suggest useful add-ons, allow us to choose from various locator strategies, and view all available properties of any UI components, etc. But have you checked their new versatile and much powerful recorder? You should check it when you get the time and share your feedback. Here are the few enhancements I noticed: 1) Added support for iFrames. I am sure this will be helpful in testing apps that play with so many iFrames. 2) Self-healing feature for the stability of the locators: I have used other tools/frameworks like Canopy(F# library built on top of Selenium) and it wasn't that effective in terms of Self-healing feature but I must say that it works very effectively when I tried using TestProject recorder to record, edit and playback. Also, if a Self-Healing mechanism was used to recover from an error, it

What all attributes should be there in your automation solution to be called a good solution?

Your automation project should have all of these to be called a good solution : Well drafted Project Design Clear Project Structure and Documentation Defined Page Objects (For UI project) Independent Automated Unit Tests Automated End to End Tests  (Loosely coupled) Reliable Locators (For UI project) Highly effective strategies for managing test data Comprehensive Dependency Management Precise and concise logging and Reporting

Jenkins: Purge Job History Plugin

Download and install: https://github.com/jenkinsci/purge-job-history-plugin This plugin provides the ability to purge all the build records of a job either via a CLI command or via the UI. When this plugin is installed it adds a new action to all Jobs with builds. You can either use UI as shown here (https://github.com/jenkinsci/purge-job-history-plugin) to purge any/all of the following:  Job Pipeline MultiBranch Job (Recursive Flag is Needed) Jobs under a Folder (Recursive Flag is Needed) All Job under Jenkins Instance (Recursive Flag is Needed) Or you can do it via Command line using this command: java -jar jenkins-cli.jar -s http://localhost:8080/jenkins purge-job-history <JobName> -r JobName : Name of the Job whose history you would like to purge r : To reset the next build number to 1 Note* you need super access to perform it.

Find “Cursor” position or currently focused element in a web page with Selenium

Problem Statement: On your registration page, you entered valid values in few mandatory fields but submit the form with no values in few of the mandatory fields. Now along with the error message(s), you want to verify that your cursor position is in the correct field (current focused element) like in the first blank mandatory field using Selenium. Solution : There are many ways to validate that but the simplest one would be to use:> driver.switchTo().activeElement() Use : Switches to the element that currently has focus within the document currently "switched to", or the body element if this cannot be detected. This matches the semantics of calling " document.activeElement " in JavaScript. Returns : The Web Element with focus, or the body element if no element with focus can be detected. And then you can put assertion based on your expected focused element, something like: Assert.assertTrue(driver.findElement(By.xpath("//input[@type='password']"