Console functionality

Ranorex Spy, Recorder, and Studio.
Basil
Posts: 1
Joined: Fri Jun 27, 2008 11:59 am

Console functionality

Post by Basil » Fri Jun 27, 2008 12:07 pm

Hi

Is it possible to run the RanorexRecorder with the console.

I would like to do the following stuff:
- Execute a ranorex python script with the console
- Record a script and save the script to a given file

Thanks,
Basil

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

Post by Support Team » Fri Jun 27, 2008 1:39 pm

You can find the answer in the following document:

http://www.ranorex.com/gui-testing-guid ... nputs.html

The Ranorex Recorder provides different types of file export by selecting the "Save" button.

- Project file (XML-based)
- Code files (C#, C++, Python)
- Executable (*.EXE)

Using the generated code

You can copy the code into your existing test application or you can compile it directly with a C# or C++ compiler or start the Python interpreter.

You do not need Visual Studio to compile the generated code. You can call the C# or C++ compiler from a batch file and generate an executable:
SET CSCEXE="C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc"
call %CSCEXE% /out:test1.exe /r:RanorexNet.dll test1.cs
call test1.exe
Batch sample for C++
cl /I ..\..\Include /Fetest1.exe test1.cpp /link /LIBPATH:..\..\lib oleacc.lib ranorexcore.lib
call test1.exe

The Python interpreter can also be started directly:
call Python test1.py

Using the generated executable

The generated executable can be started directly. It contains all needed components and the .exe runs in all Windows versions. The executable is only dependent on six Windows libraries, all of them are part of the Windows operating system.

The .exe is a Win32 console application but it doesn't open a command line box. It exits with 0 if successful, otherwise 1.

The executable cannot be opened or modified with the Recorder.

Using the XML file

The recorded data can be saved and re-opened as an XML file.
You can replay the recorded data with the Recorder from command line as follows:

RanorexRecorder.exe test1.xml

Jenö
Ranorex Team