Run Test Suit using .exe file

Ask general questions here.
Nagarjuna
Posts: 14
Joined: Fri Sep 26, 2014 6:23 am

Run Test Suit using .exe file

Post by Nagarjuna » Mon Nov 10, 2014 1:57 pm

Hi,

I am not able to run the test suite using the .exe generated in the debug folder. Earlier i have tried it, it was worked fine. When we double click on .exe generated in debug folder, execution has started and completed successfully. Now also it is starting the execution but when ever the script is depending on some repository item, from that step the test case is failing.

I run the same test suite through Ranorex studio it was executed in fine way. And i have tried using Ranorex Test suit runner for the same solution which is available at debug folder, in this way also it is absolutely running fine.

Please let me know is we need to change any setting before debugging the Test Suite?

Thanks,
Nagarjuna

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Run Test Suit using .exe file

Post by Support Team » Tue Nov 11, 2014 2:44 pm

Hi Nagarjuna,

Have you tried starting the exe as administrator by right clicking and selecting "Run as administrator"?
When the Ranorex Test Suite Runner is able to execute the exe you should normally also be able to manually execute it. May I ask you which error message you are getting when you manually execute the exe file?
Please also tell me which Ranorex version you are using.

Thanks,
Markus

Nagarjuna
Posts: 14
Joined: Fri Sep 26, 2014 6:23 am

Re: Run Test Suit using .exe file

Post by Nagarjuna » Wed Nov 12, 2014 7:28 am

Hi Markus,

Thanks for the reply..

I already tried, starting the exe as administrator but it is not worked.

I am using Ranorex Version 5.2.0.20272.

As i mentioned earlier, it is starting the execution. When ever it is depending on some repository item, it is throwing error as 'Not able to find the object' in the command window.

Exact error message is: 'Failed to wait for item to exist....No element found path (Some repository item path)'.

Once again remind you that, it is working fine when you run through Ranorex Test Suit runner in any machine with only debug files.

Thanks,
Nagarjuna

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

Re: Run Test Suit using .exe file

Post by odklizec » Wed Nov 12, 2014 8:18 am

Hi,

Did you try to perform clean solution/project and rebuild the project?
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

Re: Run Test Suit using .exe file

Post by Nagarjuna » Wed Nov 12, 2014 9:49 am

Hi Odklizec,

Thanks for the reply..

Yes, I did clean solution after that i did rebuild. Even though it is not continuing with execution.

Here one surprise is, we have earlier .exe files which have running correctly, those also not running now.

Regards,
Nagarjuna

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

Re: Run Test Suit using .exe file

Post by odklizec » Wed Nov 12, 2014 10:25 am

OK, did you try to track the failing element with the standalone spy (outside the studio)? I mean, start the standalone spy and paste the failing xpath to the spy path edit field. If spy fails to find the element as well, then the actual xpath is most probably different? So try to track the element and compare both repo and actual 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

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

Re: Run Test Suit using .exe file

Post by krstcs » Wed Nov 12, 2014 3:50 pm

I agree with odklizec.

You need to check that the XPath for the element is still correct. More than likely the developers changed the structure of the objects and you need to adjust your paths accordingly.
Shortcuts usually aren't...

Nagarjuna
Posts: 14
Joined: Fri Sep 26, 2014 6:23 am

Re: Run Test Suit using .exe file

Post by Nagarjuna » Mon Nov 17, 2014 7:28 am

Hi All,

I tried identifying the object in both ways, using SPY and Editing the current XPath in repository. Both the paths are same and identifies the object correctly.

Still not able to run the .exe file uniquely other than depending on Ranorex Studio or Ranorex suit runner.

Please share the solution as early as possible.

Thanks,
Nagarjuna

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

Re: Run Test Suit using .exe file

Post by odklizec » Mon Nov 17, 2014 8:39 am

That's weird. OK, I would suggest to remove the failing element from the repository and try to add it again. If it still fails, then try to add the report action with "snapshot" parameter (right before the failing action) and specify the parent/root element of the failing one. Then run the test both from studio and command line and compare both snapshots, especially the path pointing to "failing" element.
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

Re: Run Test Suit using .exe file

Post by Nagarjuna » Mon Nov 17, 2014 2:01 pm

Hi,

Finally i got the exact problem but not able to identify the solution. We are automating Windows 8.1 Metro Application.

The problem is with the Win 8.1 Metro apps. It is not identifying any object under the /winapp[@some property] including root.

Ex XPath : /winapp[@packagename='Microsoft.WindowsCalculator']/button[@automationid='num1Button']

Steps to reproduce:
1. Open any window 8.1 Metro app Ex : Windows 8.1 Calculator Metro app(Comes with Windows 8.1 OS installation)
2. Automate few steps.
3. Run through Suite runner. (Working Fine)
4. Run through exe generated in debug file by double clicking on it.

It is giving object not identified error in command window.

Hope the above information will help to reproduce the issue. And please let me know if you find any solution to work correctly.

Thanks,
Nagarjuna

Nagarjuna
Posts: 14
Joined: Fri Sep 26, 2014 6:23 am

Re: Run Test Suit using .exe file

Post by Nagarjuna » Wed Nov 19, 2014 11:45 am

Hi All,

Finally we got the solution to run the .exe file for windows apps.

It is bit simple but took lots of time to find it..

The below four lines of code will come by default in Program.cs file of Every ranorex solution.

// Uncomment the following 2 lines if you want to automate Windows apps
// by starting the test executable directly
// if (Util.IsRestartRequiredForWinAppAccess)
// return Util.RestartWithUiAccess();

Hope by reading the above lines, can guess the solution.

Solution is have to remove comments for the last two lines of code mentioned above before build the solution.

Thanks,
Nagarjuna