Unable to run my Ranorex test cases from command line

Ask general questions here.
gary444
Posts: 5
Joined: Tue Feb 04, 2020 9:05 am

Unable to run my Ranorex test cases from command line

Post by gary444 » Tue Feb 04, 2020 9:14 am

Hi,

I am trying to run my Ranorex test cases from command line. I am running the projectname.exe file from the bin/debug folder through command line. But once I run it just get stuck and does not move forward nor it returns any error message when I run it. My test cases are just launching a web application and verifying some UI elements and also these are running perfectly fine when I am running these tests via Ranorex studio.
Please help me on this issue.
Attachments
cmdIssue.png
cmdIssue.png (14.57 KiB) Viewed 273 times

McTurtle
Posts: 297
Joined: Thu Feb 23, 2017 10:37 am
Location: Benedikt, Slovenia

Re: Unable to run my Ranorex test cases from command line

Post by McTurtle » Tue Feb 04, 2020 9:41 am

Hello gary444,

I would first try to move the test to the c-drive and see if the same problem appears when running it from there.
Does this help?

Regards,
McTurtle

gary444
Posts: 5
Joined: Tue Feb 04, 2020 9:05 am

Re: Unable to run my Ranorex test cases from command line

Post by gary444 » Tue Feb 04, 2020 9:50 am

Thanks McTurtle for your reply.
Facing the same issue while running from C drive. PFA the screenshot.
Does this really depend where our project resides in our directory?
Attachments
cmdissue1.png
cmdissue1.png (54.24 KiB) Viewed 268 times

McTurtle
Posts: 297
Joined: Thu Feb 23, 2017 10:37 am
Location: Benedikt, Slovenia

Re: Unable to run my Ranorex test cases from command line

Post by McTurtle » Tue Feb 04, 2020 9:54 am

Hey gary444,

If D-drive would be a mapped network location... But that is not very likely. It could also be a AV issue or generally a permission issue. Try to disable your AV and try to run CMD as administrator. Is there a difference?

Also, you can try to un-comment the following two lines in Program.cs:
Launcher.png
Launcher.png (15.72 KiB) Viewed 264 times
Regards,
McTurtle

gary444
Posts: 5
Joined: Tue Feb 04, 2020 9:05 am

Re: Unable to run my Ranorex test cases from command line

Post by gary444 » Tue Feb 04, 2020 10:19 am

Thanks McTurtle.
The un-commenting of those 2 lines worked for me though I would like to understand the significance of these, as my application under test is a web application which I am running on chrome browser. So doesn't understood the issue here while running through cmd.

Also, I faced the same issue with administrator rights as well. But I don't what AV means here so did not try that.

McTurtle
Posts: 297
Joined: Thu Feb 23, 2017 10:37 am
Location: Benedikt, Slovenia

Re: Unable to run my Ranorex test cases from command line

Post by McTurtle » Tue Feb 04, 2020 3:19 pm

Hi gary444,

AV = Anti Virus. This will start the test exe elevated. Why it does not work for you without this, I cannot say :( But it is definitely a permission issue.

Regards,
McTurtle

gary444
Posts: 5
Joined: Tue Feb 04, 2020 9:05 am

Re: Unable to run my Ranorex test cases from command line

Post by gary444 » Wed Feb 05, 2020 6:25 am

ok. But just wanted to know why uncommenting those 2 lines worked for me?
Also, as I am running these through Jenkins I am unable to get the logs on Jenkins console now after uncommenting the mentioned lines and how could I get these logs on Jenkins console?

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

Re: Unable to run my Ranorex test cases from command line

Post by Support Team » Wed Feb 05, 2020 10:27 am

Hello gary444,

Thank you for your post.

Uncommenting those 2 lines within the Program.cs file restarts the test executable with elevated privileges. This is usually necessary when having strict User Account Control settings.

Due to the restart, the logging might get affected when executing the test via Jenkins.

I’m afraid there are only two approaches to resolve the behavior:
I hope this helps.

Best,
Robert
.
Image

gary444
Posts: 5
Joined: Tue Feb 04, 2020 9:05 am

Re: Unable to run my Ranorex test cases from command line

Post by gary444 » Wed Feb 05, 2020 10:54 am

Thanks Robert for the insight.
I have disabled UAC but still facing the same issue.
Is there any other way in which we can start the test cases and get the logs on Jenkins?
And again thanks for providing the information. :)

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

Re: Unable to run my Ranorex test cases from command line

Post by Support Team » Thu Feb 06, 2020 10:01 am

Hello gary444,

As mentioned before, you would need ensure that it’s not required to start the test with elevation. Unfortunately, it's not really possible to tell why it's required on your machine, but it's definitely related to missing privileges. It's maybe possible that the UAC is set via group policy as well. Also, it might be necessary to have local admin right for your logged in user.

Thank you for your understanding.

Best,
Robert
.
Image