Page 1 of 1

Cross Browser Testing - "Open Link in New Tab" Question

Posted: Tue Oct 21, 2014 12:07 pm
by Fergal
I have a test that includes the following steps;
  1. Right click on an element on a web page
  2. Click "Open Link in New Tab" on the context menu.
The first step is working on IE, Chrome, Safari and Firefox. The second step 'Click "Open Link in New Tab" on the context menu' is working in IE, but NOT in Chrome, Firefox or Safari.

How can I get the step to run on all browsers?

Thanks!

Re: Cross Browser Testing - "Open Link in New Tab" Question

Posted: Tue Oct 21, 2014 1:41 pm
by Fergal
I also have a cross browser issue with the validation of text in a tooltip. The text may be displayed using an "alt" or "title" tag. Ranorex can validate the tooltip text in IE, Chrome and Safari, but NOT in Firefox. The Xpath is:
/tooltip[@text='Help']
The validation failure message states:
Element for item 'Self' does not exist (Failed to find item 'Dashboard_IERepository.Help_Tooltip.Self'. No element found for path '/tooltip[@text='Help']' within 30s.).
What can I do, to ensure this validates correctly in Firefox?

Thanks again!

Edit: Updated for tooltip clarification.

Re: Cross Browser Testing - "Open Link in New Tab" Question

Posted: Wed Oct 22, 2014 2:10 pm
by Support Team
Hi Fergal,

It seems that both problems are related to the path of your repository items.
For example:
In IE the path of the context menu items is:

Code: Select all

?/?/menuitem[@accessiblename='Open in new tab']
Whereby in Chrome the path is:

Code: Select all

.//contextmenu[@accessiblerole='MenuPopup']/menuitem[@accessiblename='Open link in new tab']
And Firefox uses the following path:

Code: Select all

?/?/menuitem[@accessiblename='Open Link in New Tab']
As you can see the path is different in every browser. Therefore, Ranorex is not able to find the desired item.
Additionally:
A possible workaround to open links in a new tab would be to use the middle mouse button or the Ctrl-key in combination with left mouse-button.

Also the tool tip is shown different in the web browsers.

In order to run your cross browser test successfully I’d recommend adapting the path to be suitable for all browser versions using regular expressions.

May I ask you to have a look at our User Guide? This section describes how to modify your path and how to use a regular expression

Regards,
Markus (S)

Re: Cross Browser Testing - "Open Link in New Tab" Question

Posted: Thu Oct 23, 2014 8:56 am
by Fergal
A possible workaround to open links in a new tab would be to use the middle mouse button or the Ctrl-key in combination with left mouse-button.
Thanks Markus, I will try that.
Also the tool tip is shown different in the web browsers.

In order to run your cross browser test successfully I’d recommend adapting the path to be suitable for all browser versions using regular expressions.
I haven't used regular expressions before. Is there any particular area of regular expressions that I should look at, to help with the tooltip issue?

Thanks again!

Re: Cross Browser Testing - "Open Link in New Tab" Question

Posted: Mon Oct 27, 2014 8:33 am
by Support Team
Hi Fergal,

Please have a look at our User Guide by following this link: http://www.ranorex.com/support/user-gui ... html#c3294

There you can find a description and samples about regular expressions.

Regards
Markus (S)

Re: Cross Browser Testing - "Open Link in New Tab" Question

Posted: Mon Oct 27, 2014 1:57 pm
by krstcs
In addition to the page Markus linked, there are many resources on the web dedicated to Regular Expressions (Regex). In particular, I use this page quite a bit. Lots of information and examples about Regex.

One note, Ranorex is built on .NET, and .NET has it's own syntax for Regex, which is not the same as JavaScript or other common variants of Regex. They are all VERY similar, but there are a few little things that can be different if you get really deep into it.

Re: Cross Browser Testing - "Open Link in New Tab" Question

Posted: Tue Oct 28, 2014 10:32 am
by Fergal
Thanks, I will look through those resources.