Running Scripts of IE in Chrome and Firefox

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Deepak_Singh
Posts: 76
Joined: Fri Mar 14, 2014 2:37 pm

Running Scripts of IE in Chrome and Firefox

Post by Deepak_Singh » Tue Apr 08, 2014 8:03 am

Hi All,

I have written scripts of a Web Application using the Repository for IE.
Now I want to run the same scripts in different browsers Chrome and Firefox.
How will I be able to do that? :?:

Please Note that no Recording is been used. :mrgreen:

Note:- I am using Ranorex 5.0.1 Trail version.
Will it be a Roadblock for Cross browser testing? :?:

Thanks in Advance,
Deepak :lol:

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

Re: Running Scripts of IE in Chrome and Firefox

Post by odklizec » Tue Apr 08, 2014 9:16 am

In an ideal world, all you would need to do is to run your existing test with other browsers and it should work on all of them. Sadly, in a real world, each web browser interprets HTML slightly different and therefore, some xpaths could be different.

I would suggest you to run your existing test (developed with IE) with FF or Chrome. It will most probably fail to recognize some elements. When the test fails, all you need to do is to edit the failing xpaths to make them recognizable in each browser. I'm afraid, there is most probably no other way than to manually edit each failing path.
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

Deepak_Singh
Posts: 76
Joined: Fri Mar 14, 2014 2:37 pm

Re: Running Scripts of IE in Chrome and Firefox

Post by Deepak_Singh » Tue Apr 08, 2014 6:40 pm

Ok but what happens if I run the scripts on chrome and after that I want to again run the script on IE.

Will I have to change xpths again???

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

Re: Running Scripts of IE in Chrome and Firefox

Post by krstcs » Tue Apr 08, 2014 6:50 pm

All you should need to do is put variables in the XPath and then bind the variables to Global Parameters or a data connector and put the browser name in the parameter.

The whole point of xpath is that you should be using variables where needed to make it so you don't have to change the xpath unless something actually changes in the application.

And, the browser information should be kept out of the xpath as much as possible. You probably don't need it at all in most cases. The only place you should need the browser info is in the module that you are using to start up the application under test. If you are using browser name, etc., in the xpath, you probably need to go back an re-examine how you are identifying objects.
Shortcuts usually aren't...

Deepak_Singh
Posts: 76
Joined: Fri Mar 14, 2014 2:37 pm

Re: Running Scripts of IE in Chrome and Firefox

Post by Deepak_Singh » Wed Apr 09, 2014 2:14 pm

Hi krstcs,

It seems to be a good solution but It would be of great help if you could show us by example:
For example:-Add google search button from IE and command can be click.
Now run the same for Chrome with same object.

Please could you do that and post it here.

Thanking in Anticipation,
Deepak

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

Re: Running Scripts of IE in Chrome and Firefox

Post by krstcs » Wed Apr 09, 2014 2:22 pm

The best thing for you to do would be to read the documentation, top-to-bottom. Almost all of the questions you are asking are answered in the documentation in some form. Plus you will learn a lot more that you didn't even know you needed to ask about:

http://www.ranorex.com/support/user-guide-20.html
Shortcuts usually aren't...

Deepak_Singh
Posts: 76
Joined: Fri Mar 14, 2014 2:37 pm

Re: Running Scripts of IE in Chrome and Firefox

Post by Deepak_Singh » Wed Apr 09, 2014 3:19 pm

Hi,

I have read that and have tried that already. Its taking the whole page as a object.
That is why i have posted in the forum.

Please try to help if you can.

Is trial version a limitation to Cross Browser testing is my main concern here?

Thanks,
Deepak

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

Re: Running Scripts of IE in Chrome and Firefox

Post by krstcs » Wed Apr 09, 2014 3:57 pm

The trial version is not limited in functionality, it just pops up the warning dialog when you start, and won't work after 30 days.

As was posted in the other thread about seeing the whole page, there is probably something wrong with your install of either Ranorex or Chrome (or both). You should uninstall and re-install Chrome, and then uninstall and re-install Ranorex. Then, start Chrome and make sure the Ranorex plugin is enabled.

When you use Spy and click Track, you should be able to move the mouse over the page in question and hover over each element, and Spy should highlight just that element and popup a small tooltip that has info about the element. If that is not happening then either you have an installation problem, or the Ranorex plugin is not enabled.
Shortcuts usually aren't...