I have encountered a little problem. When I launch Internet Explorer Winrunner identifies the browser as 'Window_main_browser' when using the GUI spy. This is fine, but then when I launch another IE screen I get the description of 'Window_main_browser_1'. The number increments each time I open another IE window.
The problem I have is winrunner replays my script it looks for 'Window_main_browser' and if IE has set itself up as 'Window_main_browser_1', then my script fails.
I imagine the numbering of the window is an operating system issue, but does anyone know how I can get around this? Is there a operating system command to set the number from 1 back to zero (as in set Window_main_browser_1 back to window_main_broswer)?
One method (there may be others) - and it depends on whether or not you need to keep multiple browser windows open:
If not multiple open - then win_close the first immediately after the second opens. Ensure your win_activate and set_window statements refer to browser and not browser_n.
If multiple open:
Ensure your win_activate and set_window statements are correct for the desired window at the appropriate places in your script. You will probable need the win_activate to switch browser windows.
Let us know if this helps.
... Airborne requirements seldom land and are exempt from gravity.
If the two browsers are open to different web pages, you may be able to work around this by having your set_window/win_activate statements reference the appropriate html_frame_id as the "window". (WinRunner treats these html frames as windows, not objects.) I test an app which launches multiple browser windows at times, and this seems to work OK for me.
Charles Reace (charlesDOTreaceATverizonDOTnet) "Forward!" he cried from the rear, and the front ranks died.
The generals sat, and the lines on the map moved from side to side.
(Roger Waters, "Us and Them")
If everybody who worked with Browsers would have observed. If we are working on only one Browser at a time then the window is named as "Borwser Main Window" Only.
If you have more than one Browser Instance open then WinRunner recognises it as "Browser main Window_0", "Browser main Window_1" etc.,
Here there is one more thing we need to observ that is Physical Description of the Browser then the Location will be added with the same logical name no will be given ex:"Browser main Window_0" Physical Description: Location:0, "Browser main Window_1" Physical Description: Location:1 etc.,
So If the browser instance opened is in sequencial order then we should close them with the respective name at any order. If we are sure the application is going to launch more than one instance then it is advisible to work with _0, -1 etc., names for the browser instance. The script will work perfectly with any errors.