05-15-2022 9:47 AM
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.