JavaScript confirm in Firefox 6

Ask general questions here.
timbuethe
Posts: 15
Joined: Mon Aug 22, 2011 11:08 am

JavaScript confirm in Firefox 6

Post by timbuethe » Wed Aug 31, 2011 2:15 pm

We recently updated to Ranorex 3.1 and Firefox 6. It's great that the add-on now supports FF 4,5 and 6 and we can use a modern browser to run our tests.

However, we experience problems with JavaScript dialogs like alert and confirm when using FF6. The dialog and the contained buttons are not found by Ranorex, no matter if the module was recorded earlier (FF 3.x & Ranorex 3.0) or if I record it again using current versions.

To demonstrate the problem, I attached a simple HTML-page and a Ranorex solution that fails to execute. Any answers if this is a bug and if and how we can workaround this are highly appreciated.

- Tim
Attachments
DialogTest.zip
(328.78 KiB) Downloaded 211 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: JavaScript confirm in Firefox 6

Post by Support Team » Thu Sep 01, 2011 10:01 am

Hi,
Any answers if this is a bug and if and how we can workaround this are highly appreciated.
This is because Firefox does not open the pop up in the "HTML DOM" object of the appropriate web page, so it is not really possible for us to display it in the DOM tree.
This is a known issue, but it is very hard to fix it as the Firefox represents it in such a weired way.
As workaround you can search for the pop up in the "main" Firefox tree, the following RxPath includes the Path to your sample pop up:

Code: Select all

/form[@processname='firefox']/container/container/container/form[@accessiblerole='Dialog']

/form[@title='Mozilla Firefox']/container[@accessiblerole='PropertyPage']/container/container/form/button[@accessiblename='OK']
Regards,
Markus
Ranorex Support Team
.
Image

timbuethe
Posts: 15
Joined: Mon Aug 22, 2011 11:08 am

Re: JavaScript confirm in Firefox 6

Post by timbuethe » Mon Sep 05, 2011 9:58 am

We tried to make the XPath expressions as general as possible. We addressed the OK button like this:
/form//button[@accessiblename='OK']
The weird thing is this: When I click "highlight", the button is found and gets highlighted. But while executing the test, it isn't found and a timeout occurs.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: JavaScript confirm in Firefox 6

Post by Support Team » Mon Sep 05, 2011 12:34 pm

Hi,
The weird thing is this: When I click "highlight", the button is found and gets highlighted. But while executing the test, it isn't found and a timeout occurs.
This is because Ranorex takes too long to find the button, if you increase the search timeout there shouldn't be a problem.
But this is not a good way, because it takes too long to find the element, do you have tried to use the RxPath above ?
The RxPath above worked on our machines, so it also should work on yours.
Which RxPath do you have used for the identification of the button?

Regards,
Markus
Ranorex Support Team
.
Image

timbuethe
Posts: 15
Joined: Mon Aug 22, 2011 11:08 am

Re: JavaScript confirm in Firefox 6

Post by timbuethe » Mon Sep 05, 2011 1:57 pm

Support Team wrote:
The weird thing is this: When I click "highlight", the button is found and gets highlighted. But while executing the test, it isn't found and a timeout occurs.
This is because Ranorex takes too long to find the button, if you increase the search timeout there shouldn't be a problem.
Well, when I use the highlight button, it is found instantly. Within the test a 1.5 minute timeout is reached. I also tried the path you provided and it didn't work in the test nor in highlight.

Besides, the track function in "Ranorex Spy" can't find the OK or Cancel button either. It highlights elements from the underlaying page.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: JavaScript confirm in Firefox 6

Post by Support Team » Tue Sep 06, 2011 9:20 am

Hi,

please try to use a more specific RanoreXPath instead of the very general one you use.
If you try to use such a general one this will take a long time to find all elements fitting, as your while system under test will be examined.

Of course the highlight button will find your OK button isntantly as a unique path is known for the element in your hierarchy in Ranorex Spy.
The RanoreXPath Markus mentioned might not 100% fit for your system, so please adapt it to fit.
Just take the path for your OK button you have found within observing your hierarcky in Ranorex Spy.
Then not the whole system under test must be searched and your button should be found instantly.

Kind regards,
Tobias
Support Team
.
Image