question

rssenthil avatar image
rssenthil asked rssenthil posted

Window target is dynamically changing in iTest web session

 

Hi Team,

 

We are facing an issue while trying to automate the web application(Cisco ACS server 5.1).

 

After clicking a tab in the ACS web application a new window is opening with the window id number.

iTest using this window id number to open the corresponding window.

This window id number is dynamically changing for every time running the script.

 

Hence We are getting the error message 'Window 'Reports1287038107875' not found' while running the testcase.

 

Can you please give your suggestions to resolve this issue.

Please inform us if this is an iTest limitation.

 

Here with i have enclosed the web application and testcase screenshots for your reference.

 

Thanks,

R.S.Senthil kumaran

iTestGUI Testing(Web-Java Swing-etc)
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
PreetS avatar image
PreetS answered PreetS posted

Well if the web application itself is generating random IDs, it is not iTest's fault. 

IDs and names are designed to be unique. 

 

In any case, you have two obvious options:

 

1) ask the developers to give a more generic name. 

 

2) Perform 'listWindows' action. This will give you the names of all the windows. Extract the name of the new window and then use it in your selectWindow step

8 comments
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

rssenthil avatar image rssenthil commented ·

Hi Preet,

 

Thanks for your response. We tried with list windows option.

Its providing the window name. This window name is changing dynamically every time while we opening the window.

Hence the script unable to point to the correct window.

 

Do you think ACS is generating different window id and not iTest.

 

Please find the listwindows output that we got.

 

Current Window: Reports1287124372562

There are 2 windows open:
Window 1: MainWindow
Window 2: Reports1287124372562

Frame structure of windows:

MainWindow:
MainWindow -> contentFrame

Reports1287124372562:
Reports1287124372562 -> Unnamed Frame
Reports1287124372562 -> contentareaframe

 

Thanks,

R.S.Senthil kumaran,

0 Likes 0 ·
PreetS avatar image PreetS rssenthil commented ·

iTest does not generate random names like these. It is coming from ACS. 

 

What i was trying to say is that you can do listWindows and extract the window name and store it in a variable. So it doesnt matter what its dynamic value is. 

Now, whenever you do selectWindow, instead of the window name in the command field, use this variable. Now it does not matter what dynamic name it has, just get it from the list windows and use it later. 

0 Likes 0 ·
rssenthil avatar image rssenthil PreetS commented ·

Hi Preet,

 

We tried the steps that you have suggested. It's not working.

 

Listwindows option not listing the window id before selecting the window.

Please find the Listwindows output.

 

Before selecting the window::

------------

Current Window: MainWindow

There are 2 windows open:
Window 1: MainWindow
Window 2:

Frame structure of windows:

MainWindow:
MainWindow -> contentFrame

:
No frames present in this window
-------

 

Aftere selecting the window::

------------

Current Window: Reports1287417843948

There are 2 windows open:
Window 1: MainWindow
Window 2: Reports1287417843948

Frame structure of windows:

MainWindow:
MainWindow -> contentFrame

Reports1287417843948:
Reports1287417843948 -> Unnamed Frame
Reports1287417843948 -> contentareaframe
-------

 

If possible shall we have a remote session to solve the issue.

 

Appreciate your help.

 

Thanks,

R.S.Senthil kumaran,

0 Likes 0 ·
PreetS avatar image PreetS rssenthil commented ·

It's likely you are running into a timing issue here. 

You may be executing "listWindows" before a window name has been assigned. 

 

Make sure your "listWindows" step is after the action that causes a window to popup. (e.g. a click that causes a new popup window)

Put a sleep before the "listWidows" for a few seconds allowing the window to initialize. 

 

This is not a clean solution, I just want to confirm that it's a timing issue

0 Likes 0 ·
rssenthil avatar image rssenthil PreetS commented ·

Hi Preet,

 

Thanks. We gave enough sleep for the new window to come.

Now listwindows listing the windowid in the listwindows response.

We have stored the window id and used the same in select window command.

Now it's able to point to the appropriate window.

 

Thanks,

R.S.Senthil kumaran,

0 Likes 0 ·
PreetS avatar image PreetS rssenthil commented ·

Now that you have it working, you should thing about getting rid of the sleep. 

The proper way to do it would be to do a repeatStep; i.e. you repeat the listWindows action till you get a proper name; and then move on. 

0 Likes 0 ·
neeudla avatar image neeudla PreetS commented ·

 

Hi 

 

I followed the same procedure  but everytime this is not working. I mean still i am observing time issue.

 

Here I have one question that is how i have to verify  number of  authorization attempts? and accounting information ?

 

 

 

Regards

Neelakantam

 

0 Likes 0 ·
PreetS avatar image PreetS neeudla commented ·

Neeudla, I am not sure what you mean by authentication attempts. 

The above posts were talking about HTML popup windows. The HTTP credentials are completeley different paradigm. 

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.