Question

How to know the window associated to the window handle using Web Automation?

  • 2 January 2024
  • 5 replies
  • 74 views

Badge +4

I am using Web automation package and I have multiple window . When I use select Window after the get windows action. I do for example Select Window WindowHandle[1] and It doesn’t select the same window for some execution. 

 

The issue is with the Web Automation  package. Fo exaample you can do Select Window Handle[1] it select window A .you execute again the same code it selects window B.

 

How I can be sure of which window handle correspond to this window? 


5 replies

Userlevel 3
Badge +7

Hi @LnMamou,

I think you should use “Activate” Command from Window package. For sure it will work. After that you can use the other subsequent actions.

 

Hope this helps!

Badge +4

@Abhay Naik  When I use Activate command , it activates the window but Web Automation package doesn’t recognize the window as activated window

Badge +3

@LnMamou,

Use the same windows variable in Activate command and the Recorder command.
 

Badge +3

Loop over window handles :

  switch to current handle

  get URL/ Title of the current handle

  if URL/ Title of the current handle == desired URL/ Title

  break;

 

Badge +4

Hello @Sumit.K11 ,

Yes  I did like this yesterday. I repeat the loop every time I need to select a window around 6 times. 

I hope that there will be an upgrade on this package in the feature

Reply