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
JavaScript confirm in Firefox 6
JavaScript confirm in Firefox 6
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: JavaScript confirm in Firefox 6
Hi,
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:
Regards,
Markus
Ranorex Support Team
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.Any answers if this is a bug and if and how we can workaround this are highly appreciated.
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']
Markus
Ranorex Support Team
Re: JavaScript confirm in Firefox 6
We tried to make the XPath expressions as general as possible. We addressed the OK button like this:
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./form//button[@accessiblename='OK']
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: JavaScript confirm in Firefox 6
Hi,
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
This is because Ranorex takes too long to find the button, if you increase the search timeout there shouldn't be a problem.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.
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
Re: JavaScript confirm in Firefox 6
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.Support Team wrote:This is because Ranorex takes too long to find the button, if you increase the search timeout there shouldn't be a problem.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.
Besides, the track function in "Ranorex Spy" can't find the OK or Cancel button either. It highlights elements from the underlaying page.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: JavaScript confirm in Firefox 6
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
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