Highlighted
Absent Member.
Absent Member.
1469 views

Browser control not switching to new tab to perform user actions using LeanFT

Using LeanFT, when I clicked on any link in the opened browser (1st tab) it opens a new tab in the same browser but actions are not performing on the newly tab(2nd tab), basically browser control is not switching to new tab to perform execution,

Version installed : 12.54

 browser.navigate("url");
 browser.describe(Link.class, new LinkDescription.Builder().innerText("text").build()).click();
 Browser browsertab = BrowserFactory.attach(new BrowserDescription.Builder().openTitle("title").build());
 browsertab.describe(Link.class, new LinkDescription.Builder().innerText("itext").build()).click();

The above solution throws exception, com.hp.lft.sdk.ReplayObjectNotUniqueException: attachApplication

Please suggest 

Tags (1)
0 Likes
1 Reply
Highlighted
Regular Contributor.
Regular Contributor.

Re: Browser control not switching to new tab to perform user actions using LeanFT

You received a ReplayObjectNotUniqueException exception when performing the attach operation.

This means that the description you have for your new tab (new BrowserDescription.Builder().openTitle("title")) is met by multiple browsers (basically, there are more browsers that have the value "title" for the openTitle property than just one)

Try making your description more unique (perhaps by making use of the url property).

Or you could make use of the BrowserFactory.getAllOpenBrowsers() method and loop over the returned Browser[] list. 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.