Page 1 of 1

Running Ranorex from Command Line

Posted: Wed Jul 07, 2010 7:25 am
by jainaakash
Hi Team,

I tried to run Ranorex from Command line, but was not able to succeed. Please list the steps to do so. Also, where are all the options listed for this. I could see a sample in the userguide, but that also didnt help me.

I moved to location: C:\Program Files\Ranorex 2.3\Bin\
and ran the below command:
Ranorex.Recorder.exe /rp C:\RanoreX\Test\Recording1.rxrec /p /q

Got the error as: "Code Items are skipped during recording file playback."

Also, I tried to run the RanorexStudio.exe and gave the project exe path but no luck.
I need to run the entire solution/project. Please suggest.

Thanks

Re: Running Ranorex from Command Line

Posted: Wed Jul 07, 2010 10:30 am
by Support Team
Hi,
jainaakash wrote:Got the error as: "Code Items are skipped during recording file playback."
Because code items are - as their name suggests - defined by source code and need to be compiled and executed by the generated Ranorex application in order to run.
jainaakash wrote:Also, I tried to run the RanorexStudio.exe and gave the project exe path but no luck.
I need to run the entire solution/project. Please suggest.
Compile and run the generated Ranorex application by pressing the <F5> key on your keyboard or by selecting "Debug -> Run" from the Ranorex Studio menu bar.
When you compile your project to an executable, you can then easily start that executable from the command line.

Please also take a look to our tutorial
http://www.ranorex.com/Documentation/Ra ... torial.pdf

Regards,
Peter
Ranorex Support Team

Re: Running Ranorex from Command Line

Posted: Wed Jul 07, 2010 11:53 am
by jainaakash
Thanks Peter,

I was able to run the exe from the cmd. But I had tried running the RanorexStudio and Ranorex recorder exes then the path of the actual exe which didnt work.

Now, next I want to pass some commandline arguments while running the exe. Is it possible for VB.NET proj.?
The main function in a VB solution/project is defined as :
Function Main() As Integer
and does not have any args, whereas the Main function for a C# proj is defined as:
public static int Main(string[] args)

I have gone through the link:
http://www.ranorex.com/blog/defining-ex ... ur-ui-test

Thanks.

Re: Running Ranorex from Command Line

Posted: Wed Jul 07, 2010 11:59 am
by Support Team
Hi,

Here is a sample code for the main with arguments in VB .Net
Shared Sub Main(ByVal args As String())
    For Each arg As String In args
        Console.WriteLine(arg)
    Next arg 
    Console.ReadLine()
End Sub
Regards,
Peter
Ranorex Support Team

Re: Running Ranorex from Command Line

Posted: Wed Jul 07, 2010 1:01 pm
by jainaakash
Thanks Peter,

I had tried the same code earlier which didn't work BUT when u gave it, it worked with some modification.. :) Thanks.

Main has to be declared Public and not Shared. I had added that in Program.vb.
That's what the message said when I declared Main as Shared:
-------
Methods in a Module cannot be declared 'Shared'. (BC30433) - C:\FlagStone\Automation\POC\RanoreX\VB\cmdLine\cmdLine\Program.vb:65
-------

Thanks.