How OpKey uses Visual Identification mechanism to find dynamic objects based on labels/text?
Its difficult to automate dynamic applications and believe us, it takes serious efforts to automate these applications. Applications like Salesforce, Workday, Oracle Cloud, etc are some of the very commona examples which we can think off. In all such applications, object properties gets changed dynamically. In such cases, maintaining the test case is quite challenging task for the QA teams.
If you are also facing such challenges while automating your web application which is getting updated with different properties then you can handle it by using new set of OpKey keywords. Let’s talk about how this problem can be solved with OpKey. We have designed keywords in Opkey which works on the advanced visual identification mechanism, which helps in handling complex scenarios in which test execution was getting failed in earlier cases.
By using these keywords, you just need to add new test step(s) with the corresponding keyword and provide the text or label (with index value in case of multiple similar text and label based objects). Thus, you don’t need to create a new test case & object repository for the updated web application and then map test case with respective object and automate the application.
OpKey keywords with new visual identification mechanism:
|OpKey Keywords with Advanced Visual Identification Mechanism|
Let us discuss about some of the common scenarios which can now be handled easily by using these keywords.
(1) Scenario 1:
Suppose you have a Test Case or Function Library having some test steps (with OpKey keywords having ByText as suffix). After sometime, your web application gets updated with a new option and you have to update your existing test case (or function library) while adding a new test steps for this newly added option.
Resolutions: Now, you have some limited options to handle this scenario. You can record the required object and map with the test step. As per the new enhancements in the functionality of such keywords, you just need to provide the text of the newly added option on your web application. If there are multiple simmilar text on the web application then you need to provide the text with the index value on which you want to perform the action. Thus, here, you don’t need to record or fetch the required object to update your test case and then map it with the keyword. You just need to provide the text (and index in case of multiple same text existing on the web page).
(2) Scenario 2:
Suppose there are multiple frames on the web application along with the similar text options on which you have to perform action during test automation. In case of further updates in the application, new frames with new similar text or labels may get added. Now, you have to automate the application while creating new test case or maintaining the existing one.
Resolutions: Now, with the help of these keywords, you can easily handle such scenarios seamlessly as here you don’t need to look into the unique object properties to identify the object and perform the cation. Here, you just need to provide the text (and index value in case of similar text based objects) on which you want to perform the action. It automatically handles all the complex scenarios (multiple frames with similar text objects) and perform the desired action.
(3) Scenario 3:
Suppose there is a test case to automate an application but during test execution the object (mapped with your test case step) gets relocated from one frame to the another frame. Now, you have to handle this scenario and automate this application which is a challenging task.
Resolutions: In order to handle such scenarios, you first need to find out the current existing frame of the object, apply SelectFrame keyword to select the frame in which object exists and then identify the object based on xpath or any other unique property. Now, with the help of these keywords having new visual identification mechanism, you don’t need to find out the frame, provide unique object properties to identify the object. Here, you just need to add the corresponding keyword, provide text or label of the object (and index value in case of similar text based objects) on which you want to perform the action. It automatically handles all the scenarios (switching from one frame to another and identifying the respective object for performing the desired action.
(4) Scenario 4:
Suppose you have a test case to automate an application but later the object properties (like ID, Class, Name, Title etc.) get /changed/updated or object’s frame get updated but the visible text or label remain same then you can follow any one of the following resolutions by using the newly added keywords.
Resolutions: In order to handle this scenario, you can fetch object and then map it with the keyword. Another option is providing the object properties using dynamic OR (use SelectFrame keyword if required). Now, with the help of these keywords having new visual identification mechanism, you just need to use the corresponding keyword from the above given list and provide only the text or label in data input argument (and index value in case of similar text or label based objects) on which you want to perform the action. It automatically handles all the scenarios automatically and perform the action.
By using the new set of ByText OpKey keywords having an advanced visual identification mechanism, you can handle the dynamic behavior of objects present under UAT and can maintain your existing test case easily and automate the application quickly.
Radhe Shyam Prajapati