Open Multiple IE Browser windows

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
jprelli
Posts: 2
Joined: Thu Aug 22, 2013 2:36 pm

Open Multiple IE Browser windows

Post by jprelli » Tue Apr 29, 2014 3:13 pm

Hello,
I have an odd behavior with Ranorex 5. I have a test on a web page that when it’s filled out you can open a second browser window that presents the data in the first web page in a report form like an invoice.
Keep in mind spy id's all controls just fine in both windows.
Strange behavior: If I open the first browser, fill out the data then open the report browser window, Ranorex is not able to identify any of the controls in the second open window during test run. Now if I leave the report window open (this is the second browser) Comment out the original code for the original window (the fill out portion i.e. first window) Ranorex is able to identify the items in the report window just fine.
My question is: Is there a way to run all this in one test and have Ranorex identify all controls in both browser windows. I have turned off tabbed browsing too so these are in separate windows. Any help would be greatly appreciated.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Open Multiple IE Browser windows

Post by krstcs » Tue Apr 29, 2014 3:54 pm

First, make sure that the paths to the two windows are each unique. If you haven't, I would recommend that you make a separate /dom object for the report window and make sure it is uniquely identified vs. the first window.

After that, there are a couple of things you could try:

1. Split the tests into two runs, running them in succession. (I know that isn't the solution you want, but it could be useful if, say, in the future, you want to run one without the other.)

2. Turn off object caching for the objects in the second window. It is possible that it is a caching issue (but I doubt it).


My guess as to the actual issue is that your developers just cloned the first window when they created the second, which means all of the identifying attributes are the same for the base windows, meaning Ranorex will search the first window until it finds the report (which it won't) or times out. If it finishes a full search of the first window inside the timeout window and doesn't find the report, it might (and should) move to the second window. But this might be problematic with caching and the time it takes to search for items.

If that is the case, I would ask the devs to add a unique id to the second window's structure (something like "<body id='Report Body'>...</body>" would work).
Shortcuts usually aren't...