Highlighted
Member.
227 views

How to get the number of opened browser windows(popups) in LR TruClient (Firefox)

Hi, 

In our scripts we have few steps where click on a button opens new popup browser window where we need to enter some data and close that browser window then switch the controle to main browser and do the actions.

In some situations we need to check the total number of opened browser windows(popups) before switching the control to main browser as we need to make sure that all popup browser windows are closed before switching the control to main window.

Is there any way that we can find this in truclient..? 

 

 

Thanks in Advance.

Labels (2)
0 Likes
1 Reply
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: How to get the number of opened browser windows(popups) in LR TruClient (Firefox)

Hi @shasriram ,

There is no existing api to get the total opened browser window directly, so I would like to suggest you using some javascript code to workaround, every time when a new browser window be opened in TruCleint Firefox, there would be a ordinal number (e.g. #1, #2 ...) for this window, you can create a counter using javascript and make it counter++ every time when a new window is opened.

e.g. add a eval javascript step after the open window step, define your counter in the eval javascirpt step, using this counter to track your window number.

 

Thanks,

Penn

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.