Handling Dynamic Objects using ByText Keywords - New UI

Objects are grouped as static, dynamic, or runtime based on their property behavior. Static objects maintain constant properties, while dynamic ones change due to a change in the underlying property like CSS, Xpath, etc.

In a test case, objects represent components of an application where actions are performed. Each object possesses distinct properties or attributes, such as name, XPath, CSS, tags, etc. Runtime objects are generated during execution and possess unique properties. 

Opkey identifies and fetches multiple object properties during test case creation to locate objects on the test page and perform actions during execution even if an underlying property gets changed. However, test executions often fail due to objects not being found due to changes in all of their properties. 

In such instances, you can utilize "bytext" keywords. These keywords leverage the 'Visual Object Identification Technology' to visually recognize the object within an application. For example - fetch the ‘Sign out’ button using its textual name. 

This represents a cutting-edge approach that facilitates dynamic testing across various enterprise-level applications and platforms. It locates an element with the help of its text properties and other visual attributes and acts on it. 

Let’s understand how you can use such keywords. 

Consider a scenario where a tester wants to add a logout step in a test case. He is unable to capture the logout button using the Opkey recorder as it’s a dynamic object. So we capture this button object by its name using the "Web_Click By Text" keyword to add and execute the logout action in the application. Let’s see how:


Given below screenshot shows a test case for ‘Lead generation’ workflow on a web application:


Now, we want to add the sign-out step using a keyword to the test case. To add the keyword click on the Add Step button:

Now go to the last step and add the Web_ClickByText keyword. 


Select the Set Input Data icon to enter the details. 


Enter TextToSearch as Sign Out.  


Save the workflow. 



Click on the run button to execute the test case. View the execution results post-execution.

You have now learned how to use by text keywords. 

Read more such related articles by clicking here.



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article