Command-line compile some but not all Ranorex test cases?

Ranorex Spy, Recorder, and Studio.
JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Command-line compile some but not all Ranorex test cases?

Post by JohnWashburn » Mon Sep 21, 2015 7:43 am

From the command line: How do you build some but not all Ranorex test cases of a Ranorex test suite found within a particular Ranorex solution?

This post describes how to compile some, but not all test suites found within a Ranorex solution.
http://www.ranorex.com/forum/how-to-bui ... t1888.html
This post is also test suite based:
http://www.ranorex.com/forum/how-to-exe ... t2534.html

What I want for our continuous integration system is a command line along the lines of:

Code: Select all

RanorexSolution.exe /p:SomeRanorexSolution.rxsln /s:SomeTestSuiteName.rxtst /t:TestCaseName1:TestCaseName2:TestCaseName7
I want replicate, via the command line, the run command and check-boxes found on the GUI interface shown in the attached snapshot.

My understanding of the what happens when you hit the green (Run) arrow is Ranorex Studio does a just-in-time compile based on the XML found within the .rxsln, .rxtst, and .rxtmg files the to form an EXE file within the ~\bin\(Debug|Release) directory. This just-built .EXE file is then executed and the .EXE, in turn, deposits results into the ~\Reports directory.

I would like to do the same from the command line without interacting with the GUI. The command line I am using for executing every test cases within some but not all test suites within a solution is the following Powershell script line. It uses visual studio to build a constellation of test suites (aka *.csproj files) into a single EXE

Code: Select all

    & $MSBuild "$SolutionRoot\$SolutionName.sln" "/p:AssemblyName=$Executable" "/p:Configuration=$Configuration" "/t:$BuildTarget"
where:
$BuildTarget is the list of *.csproj files to compile


What has not worked so far:
http://www.ranorex.com/forum/running-te ... t3142.html
http://www.ranorex.com/forum/command-li ... t6948.html
http://www.ranorex.com/blog/organizing- ... ExeProject

Though to be fair the last link is still under investigation.
Attachments
RunSomeButNotAllTestCasesWithinTestSuite.png
Snap shot of how to run some but not all test cases within a test suite found within a Ranorex Solution.
RunSomeButNotAllTestCasesWithinTestSuite.png (100.4 KiB) Viewed 1471 times

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

Re: Command-line compile some but not all Ranorex test cases?

Post by odklizec » Mon Sep 21, 2015 8:22 am

Hi,

I think the best way to achieve what you want is to use Run Configurations, as described >here<.
Then in your command line use this...
RanorexSolution.exe /rc:RunConfigurationName
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

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Command-line compile some but not all Ranorex test cases?

Post by JohnWashburn » Mon Sep 21, 2015 8:49 am

The documentation is ambiguous. If I compile multiple projects within a solution (or all projects within the solution) can I have multiple -RC: arguments on the execution line>

From:
http://www.ranorex.com/support/user-gui ... html#c3019
Can the argument list be:

Code: Select all

<GeneratedTestSuite>.exe /rc:TestSuite01.rxtst /rc:TestSuite01.rxtst 

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

Re: Command-line compile some but not all Ranorex test cases?

Post by krstcs » Mon Sep 21, 2015 3:49 pm

I think there are two different topics being discussed here:

1. John wants to COMPILE different test cases in the same suite, which CANNOT BE DONE. The whole project is compiled or nothing is compiled, that is the way the compiler works and there is nothing Ranorex can do about that. Each project will have it's own EXE file. Note that a SUITE is not the same as a SOLUTION. Each project usually contains a suite, and the solution is a group of projects. You can compile single projects in the solution, but again, that compiles the WHOLE project, not just specific test cases.

2. Pavel is talking about run configurations and those relate to what actually gets executed when the test suite is run with specific parameters or settings.
Shortcuts usually aren't...

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Command-line compile some but not all Ranorex test cases?

Post by JohnWashburn » Mon Sep 21, 2015 3:58 pm

Yes, i see the two issues here. I think my application with our continuous integration system (TeamCity and Jenkins) is to compile all the projects in the solution using MSBUILD.EXE /t:Clean;Rebuild.

Once the EXE is created, then invoke the .EXE N times; once for each run configuration with the /rc:someConfiguration.rxtst

I will report back on how well this approach works for us.