Cross Browser Error Message Question

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

Cross Browser Error Message Question

Post by Fergal » Tue Mar 18, 2014 6:51 pm

I have recorded two test cases in Google Chrome, as follows:
  1. Open the browser and visit the Google website
  2. Search for "Ranorex" in Google.
Both test cases are in a single Test Suite.

The two tests run successfully in Google Chrome.

When I change the browser from "Chrome" to IE, in the first test case, that first test case still runs successfully. However, the second test case (to search for "Ranorex") fails for the reason below:
Failed to find item 'Cross_Browser_TestsRepository.Google.Gbqfq'.
No element found for path '/dom[@domain='[Google URL Removed']//input[#'gbqfq']' within 1m.
How can I fix the second test case so that I can run the test suite (of two test cases), in any browser I want?

Thanks!

p.s. "Google URL Removed" added to the quote above, because I don't have permission to post URLs on this forum.

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

Re: Cross Browser Error Message Question

Post by krstcs » Tue Mar 18, 2014 7:15 pm

You are on the right track. First a few questions so we know more about the issue:

What version of Ranorex are you using?

What version of IE are you using?

What version of Chrome are you using?

Have you made sure that the base DOM object (the ".Google" object with the path "/dom[...]") is found in IE manually by selecting Highlight in the repository while ONLY IE is open to the site?
Have you made sure that the path for the search box is found in IE manually by selecting Highlight in the repository while ONLY IE is open to the site?

If the last two questions are answered with "It didn't work" then Ranorex is not finding the objects on the web page for some reason. Use Ranorex Spy and make sure that the IE site matches the XPath.
Shortcuts usually aren't...

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

Re: Cross Browser Error Message Question

Post by Fergal » Wed Mar 19, 2014 10:07 am

Thanks for your reply and help krstcs.
krstcs wrote:What version of Ranorex are you using?.....
Ranorex Studio, Version 4.1.5.17134
krstcs wrote:...What version of IE are you using?.....
IE 10.0.9200.16844
krstcs wrote:What version of Chrome are you using?.....
Chrome Version Version 33.0.1750.154 m
krstcs wrote:...Have you made sure that the base DOM object (the ".Google" object with the path "/dom[...]") is found in IE manually by selecting Highlight in the repository while ONLY IE is open to the site?
Have you made sure that the path for the search box is found in IE manually by selecting Highlight in the repository while ONLY IE is open to the site?...
I haven't done that. What I did was record the tests in Chrome and then expected them to run in IE. Is that not possible?

Thanks again!

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

Re: Cross Browser Error Message Question

Post by krstcs » Wed Mar 19, 2014 3:41 pm

Some times it is possible, some times it is not.

Each browser engine presents the HTML a little bit differently, so we need to make sure that it works in each one, we can't just assume that it will. :D This is something that I've learned the hard way.

But, once you know that there are differences, and where they may be, you can typically create the object RXPaths in a way that will work for any of them.

I typically create objects with all the browsers that I need to test in open, so I TRACK and ADD the item to the repository from one and then make sure it matches the others. It does take a few more minutes, but once you get it done, unless the devs change things, it should work from then on.

Remember, automation is not necessarily faster than manual testing in creating tests (and usually it is much slower). Where automation shines is in running and re-running and re-re-running tests. It will do it faster than a human and exactly the same way every time so we don't have to worry about humans messing up a step and having to waste time going back. It is also much better at reporting once it is set up.

Now, once you do have a framework in place that works for you, adding new test cases will be much simpler, but it takes some time to get there.
Shortcuts usually aren't...

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

Re: Cross Browser Error Message Question

Post by Fergal » Thu Mar 20, 2014 12:01 pm

Thanks again for your helpful reply krstcs.
krstcs wrote:...I typically create objects with all the browsers that I need to test in open, so I TRACK and ADD the item to the repository from one and then make sure it matches the others...
Where can I learn more about how to do that?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Cross Browser Error Message Question

Post by odklizec » Thu Mar 20, 2014 12:45 pm

Simply go to the repository editor, here click the "Track" button and then select the element you want to compare with the other element tracked in other browser. The selected object is then added to repository. Then repeat the same steps with each web browser you would like to support.

There could happen two things:
- In case the element has the same path as an already added repository element, no new repository element is added. Hence, both web browsers interpret the HTML code the same way.

- In case the other web browser interprets the HTML code differently, Ranorex detects different path and adds a new repo element with different path. In this case, you need to compare both paths and try to make either of them recognizable by both web browsers.

You can for example replace some path elements with somewhat more generic elements, using "?" character, "*" adapter or relationship operators. All these things you can find described for example here:
http://www.ranorex.com/support/user-gui ... xpath.html
and here:
http://www.ranorex.com/support/user-gui ... ditor.html

These two articles are in my opinion crucial to learn and understand, to be able to effectively work with the xpaths.
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

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

Re: Cross Browser Error Message Question

Post by krstcs » Thu Mar 20, 2014 1:38 pm

Yep, what odklizec said. :D

Reading the user guide from top to bottom is one of the primary things that you will find helpful when learning Ranorex. They created a really nice document that will help answer a lot of your questions.

And the RanoreXPath technology is something that you will want to learn inside-out as it is the core of how Ranorex finds and identifies objects. It is very powerful.
Shortcuts usually aren't...

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

Re: Cross Browser Error Message Question

Post by Fergal » Fri Mar 21, 2014 10:00 am

Thanks everyone for your helpful replies and suggestions. I will spend some time learning more about RanoreXPath and Ranorex Spy.