Ask general questions here.
-
Fergal
- Certified Professional

- Posts: 455
- Joined: Tue Feb 18, 2014 2:14 pm
- Location: Co Louth, Ireland
-
Contact:
Post
by Fergal » Mon Nov 10, 2014 12:43 pm
I'm running cross browser tests for a web application. One of the tests includes a step to click on a confirmation button of a browser dialog box as shown below:
IE
Safari
The test step works in IE but not in Safari. My xPath and repository for the item looks like this:
How can I edit the repository, so that the test step works for all browsers?
Thanks!
-
odklizec
- Ranorex Guru

- Posts: 7469
- Joined: Mon Aug 13, 2012 9:54 am
- Location: Zilina, Slovakia
Post
by odklizec » Mon Nov 10, 2014 1:06 pm
Hi,
It does not work in Safari, because the base path refers to message title bar text, which is empty in Safari message box! You just have to find another attribute, which is the same regardless of used browser. What about this text "Confirm your choice to delete this user". Is it set by your AUT? if so, then use this text (part of it) to identify the dialog, instead of the title bar. Hope this helps?
Pavel Kudrys
Ranorex explorer at
Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
Nagarjuna
- Posts: 14
- Joined: Fri Sep 26, 2014 6:23 am
Post
by Nagarjuna » Mon Nov 10, 2014 2:14 pm
Hi,
Edit your Xpath in such a way to identify ok button in any of the window.
Ex: /form/button[@text='OK']
It identifies "OK" button in any popup generated.
Hope it helps..

-
Fergal
- Certified Professional

- Posts: 455
- Joined: Tue Feb 18, 2014 2:14 pm
- Location: Co Louth, Ireland
-
Contact:
Post
by Fergal » Mon Nov 10, 2014 6:31 pm
Thanks odklizec and Nagarjuna for your helpful replies.
odklizec wrote:/form/button[@text='OK']
I tried that approach but could not get it to work. What I did was use a workaround of replacing the step to click on the "OK" button, with a step with Key Sequence {Return}. That seems to work for all browsers. I will try using the approaches you both suggested when my knowledge and experience of xPath improves.
Thanks again!