How to Automate a new Tab in LeanFT | UFT Developer

You might have come across some scenarios in automating a web application wherein clicking a hyperlink object opens the new page in a new tab of the browser. You can not perform any operation on the objects of the newly opened tab unless you attach them first. In this tutorial, we will learn how to access and automate a new tab in LeanFT. We will use BrowserFactory class to attach the newly opened browser tab so that we can automate the new tab objects.

automate a new tab in LeanFT or UFT Developer

Example-Automate a new tab in LeanFT | UFT Developer

Code Explanation-New Tab Automation

You just simply can’t identify the objects of a web page that has opened in a new tab after clicking any hyperlink in the current object. To handle new tab objects, you will have to first attach the newly opened tab to let LeanFT identify its object. You can attach the newly opened tab using its title. The same has been done using BrowserFactory in the above code and the returned value has been stored in the Browser object type variable(TabObj)

Now using this TabObj you can access all the elements of the newly opened tab and perform the desired action.

Recommended Posts

Leave a Reply