Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to switch windows by using script

0 Kudos

Sometimes I need to use automation to handle some transactions,

Script process: click login, then open a new window and enter the user name and password.

But there is a problem here. I may have opened some windows, which will cause my script to report an error when I can't find the box for entering user name and password.

For example, I have opened a window with ID:

/app/con[0]/ses[0]/wnd[0]

The new login window ID is,

/app/con[1]/ses[0]/wnd[0]

During script operation, the default window is:

/app/con[0]/ses[0]/wnd[0]

, and then an error occurs.

How can I automatically recognize the script and switch to the correct window?

I tried using:

session.findById('/app/con[1]/ses[0]/wnd[0]').xxx

,But this will report an error.

0 REPLIES 0