Possible to run executable without .rxtst file?

Ask general questions here.
chowdhury_a
Posts: 5
Joined: Tue Mar 13, 2012 7:32 pm

Possible to run executable without .rxtst file?

Post by chowdhury_a » Wed May 23, 2012 3:52 pm

Hello,

Would it be possible to configure the build process so that the executable compiled can run without any dependency on an .rxtst file?

Thanks,
Chowdhury

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

Re: Possible to run executable without .rxtst file?

Post by Support Team » Thu May 24, 2012 2:48 pm

Hello,

Why do you want configure the build process in that way, is there a special reason for it?

Regards,
Markus
Ranorex Support Team

chowdhury_a
Posts: 5
Joined: Tue Mar 13, 2012 7:32 pm

Re: Possible to run executable without .rxtst file?

Post by chowdhury_a » Thu May 24, 2012 3:07 pm

Just to make it into an all-in-one package. Just a little less hassle.

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

Re: Possible to run executable without .rxtst file?

Post by Support Team » Fri May 25, 2012 12:27 pm

Hi,

Okay, this is a point ;).
It is possible, you have to open the properties window of the test suite, right click on your *.rxtst file in the projects view and select "EmbeddedResource" as Build Action, then you have to input a Logical Name for it.
After this you have to copy following code into your Program.cs class:
var reader = new System.IO.StreamReader(typeof(Program).Assembly.GetManifestResourceStream("The Logical Name of the RxTst file"));
var tstString = reader.ReadToEnd();
error = TestSuiteRunner.Run(typeof(Program), Environment.CommandLine, tstString);
This should make the trick.

Regards,
Markus
Ranorex Support Team