Recording a Session

Set the record filename to the VirtualUI.Recorder component and call its Rec() method to record an application session. The VirtualUI.Recorder object is used in both the recording and the playing process. These operations can be presented, for example, as two buttons in the application: "Rec" and "Stop".

In order to record a session, follow these steps:

1. Choose a file name and location for storing the session. Don't include the extension: sessions will be stored automatically as .dat and .idx.

Set the Filename as follows:

Delphi code:

VirtualUI.Recorder.Filename := 'C:\Sessions\VirtualUISession';

C++ code:

VirtualUI m_VirtualUI = new VirtualUI();

...

...

m_VirtualUI->Recorder()->Filename(L"C:\\Sessions\\VirtualUISession");

C# code:

private VirtualUI vui = new VirtualUI();

...

...

vui.Recorder.Filename = "C:\\Sessions\\VirtualUISession";

2. You can specify more than one track for each session. This allows you to, for example, store different application operations. Later, you can play play the complete session or a specific track. These tracks are indicated during the sessions recording. Call the Rec() method and pass the track name as an argument in the Label parameter:

Delphi code:

VirtualUI.Recorder.Rec('Track 1');

C++ code:

m_VirtualUI->Recorder()->Rec(L"Track 1");

C# code:

vui.Recorder.Rec(“Track 1”);

3. In order to stop the recording, call the Stop method:

Delphi code:

VirtualUI.Recorder.Stop('Track 1');

C++ code:

m_VirtualUI->Recorder()->Stop();

C# code:

Afterwards, you can start another recording with the Rec method. If you keep the same track name, the recording will resume and the session will be stored after the previous session in the same file, in a new track. Change the track name to avoid ending up with two tracks with the same name in the same session recording.

Read more:

· The OnRecorderChanged Event

· Play Recorded Sessions

· Create Your Own Player

Last updated