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

Ask general questions here.
Fergal
Certified Professional
Certified Professional
Posts: 298
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

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

Post by Fergal » Tue Oct 21, 2014 12:07 pm

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!

Fergal
Certified Professional
Certified Professional
Posts: 298
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

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

Post by Fergal » Tue Oct 21, 2014 1:41 pm

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.

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

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

Post by Support Team » Wed Oct 22, 2014 2:10 pm

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)
.
Image

Fergal
Certified Professional
Certified Professional
Posts: 298
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

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

Post by Fergal » Thu Oct 23, 2014 8:56 am

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!

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

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

Post by Support Team » Mon Oct 27, 2014 8:33 am

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)
.
Image

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

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

Post by krstcs » Mon Oct 27, 2014 1:57 pm

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.
Shortcuts usually aren't...

Fergal
Certified Professional
Certified Professional
Posts: 298
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

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

Post by Fergal » Tue Oct 28, 2014 10:32 am

Thanks, I will look through those resources.