Popup Window Repository Help

Ranorex Spy, Recorder, and Studio.
craig242
Posts: 9
Joined: Mon Jul 29, 2013 3:40 pm

Popup Window Repository Help

Post by craig242 » Mon Jul 29, 2013 3:50 pm

Hi, fairly new to ranorex automation so I'm hoping this will be easy for someone to answer.
I am looking at cross-browser testing my companies intranet based solution on IE, chrome and firefox but come across the following problem:

When I try to enter a blank username and password, an IE popup window is shown (as expected) that is different to one that is shown in Chrome for example. This creates 2 repositories for each pop up window. My question is how can I run an automated test that includes clicking 'OK' to the pop up with 2 different repositories?

I have read about PopupWatcher on the forum, but at the moment, I am only using the capture reply section (coding skills are non-existent).

Any help would be appreciated. :)
Additional details if needed: windows7, IE9, Chrome28, FF22, Ranorex4.0.5.

Thanks,
Craig

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

Re: Popup Window Repository Help

Post by krstcs » Tue Jul 30, 2013 2:06 pm

There are a couple of ways that you could do this.

The one I would look at is manipulating the XPath for the popup.

Try the following:

1. Manipulate all 3 browsers so they are showing the popup at the same time.
2. Spy the objects that you want to manipulate (e.g., "OK" button) and add the objects to the same repository (a blank one would be good).
3. Look at the XPaths for all 3 and see where they are the same.

For example, if they are like this:

IE - \dom\form\input[@innertext='OK']
FF - \dom\form\div\input[@innertext='OK']
CH - \dom\div\input[@innertext='OK']

You could make just one repository item - \dom\\input[@innertext='OK']

That will pick up all input elements with an innertext of 'OK' that reside in a webdocument (dom).

You could also try doing some RegEx work if you wanted, just in case one of them treats the tag attributes differently.
Shortcuts usually aren't...

craig242
Posts: 9
Joined: Mon Jul 29, 2013 3:40 pm

Re: Popup Window Repository Help

Post by craig242 » Tue Jul 30, 2013 4:25 pm

Thanks for the reply.

I tried to modify the Xpaths as you suggested but this has highlighted an issue we have when attempting to track the OK button on the pop up window.
It appears the OK button can be clicked on IE, but on chrome the whole box is selected and it is impossible to select the OK button on it own. On FF, the pop up window looks to be embedded onto the web page so xpath cannot identify any of that.
Issue logged with developers.

Thanks,
Craig

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

Re: Popup Window Repository Help

Post by krstcs » Tue Jul 30, 2013 5:06 pm

You might also check to make sure you have instrumented Chrome and Firefox correctly.

Many times, if the Ranorex addins are not installed or enabled, you will not see objects on the web pages.
Shortcuts usually aren't...

craig242
Posts: 9
Joined: Mon Jul 29, 2013 3:40 pm

Re: Popup Window Repository Help

Post by craig242 » Wed Jul 31, 2013 9:33 am

Thanks, I checked the add on for Chrome and FF are both installed and enabled correctly.
We are currently migrating code bases for the product which has caused the missmatch in error handling between browsers.

Thanks,
Craig