How to view Ranorex Tests in Visual Studio

Best practices, code snippets for common functionality, examples, and guidelines.
RekhaG
Posts: 17
Joined: Fri Sep 22, 2017 12:47 am

How to view Ranorex Tests in Visual Studio

Post by RekhaG » Fri Sep 22, 2017 6:39 pm

Hello,

I have developed some test cases using code modules in Ranorex Studio, but when i try to open the .sln file in Visual studio, the project compiles fine and when i click the start button it starts executing all the tests. Is there a way i can execute just one test case that i am interested in? Also, Currently i can see the test in .rsxt file in the xml format. I dont see them in the Test explorer. How can i execute only one test in Visual studio? Can anyone please help?

P.S: I am new to Ranorex

I tried searching in your Forum but could not find anything helpful.

Vega
Posts: 222
Joined: Tue Jan 17, 2023 7:50 pm

Re: How to view Ranorex Tests in Visual Studio

Post by Vega » Fri Sep 22, 2017 8:54 pm

Since you are working outside of Studio, you will either need to use the Test Suite Runner or pass arguments to the executable:
https://www.ranorex.com/help/latest/les ... orexStudio

Hope this helps

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

Re: How to view Ranorex Tests in Visual Studio

Post by krstcs » Mon Sep 25, 2017 2:28 pm

Unfortunately, Ranorex does not have a VS plugin, and it is NOT considered a test suite by the VS test harness. You cannot use it that way. In VS, you must treat it as if it were just another executable application being developed.

If you are using VS, you really can't use the Ranorex test suite structure. This is one reason I continually recommend to use Ranorex Studio only, unless you need to create some type of library or really complex module.


Note, I have added a UserVoice feature request for a Ranorex Visual Studio plugin that would act like Ranorex studio in how it handles test suites, repos, modules, and other XML-based code-behind containers.
http://uservoice.ranorex.com/forums/150 ... dio-plugin
Shortcuts usually aren't...

RekhaG
Posts: 17
Joined: Fri Sep 22, 2017 12:47 am

Re: How to view Ranorex Tests in Visual Studio

Post by RekhaG » Mon Sep 25, 2017 9:24 pm

Thank you Vega and krstcs for replying back. yeah i was mainly looking to debug a particular test case in VS as it is getting tougher to debug in Ranorex

Vega
Posts: 222
Joined: Tue Jan 17, 2023 7:50 pm

Re: How to view Ranorex Tests in Visual Studio

Post by Vega » Tue Sep 26, 2017 3:32 pm

I understand if you want to work in VS, but krstcs is correct in the regard that VS will not see Ranorex tests like Ranorex Studio / Test Runner will. However, you can specify command line arguments in VS when executing. Please give the below link a read as it should help. You will also need to reference the link I provided earlier about how to run the Ranorex test from the command line so that you know which arguments to use.

Commandline Arguments in VS when executing:
https://msdn.microsoft.com/en-us/librar ... s.90).aspx
Ranorex test arguments:
https://www.ranorex.com/help/latest/les ... orexStudio

You will likely want to look at /tc or even into run configurations to run multiple test cases with ease.

Hope this helps