Share this page

# rdp_get_text

Retrieves the text in the specified point and saves the text to a parameter. The text can later be used for correlations.

int rdp_get_text( "StepDescription=<step_description>", "Snapshot=<snapshot>", ["ConnectionID=<connection_identifier>",] "WindowTitle[/RE]=<window_title>", ["WindowOrdinal=<window_ordinal>",] "TextX=<x_position>", "TextY=<y_position>", "Text=<text_parameter>", RDP_LAST );

This function returns LR_PASS (0) on success or LR_FAIL (1) on failure. Note that LR_PASS and LR_FAIL generally indicate whether the function call completed without an exception, and not that the test step succeeded.

All string arguments (char type) can be parameterized using standard parameterization.

Argument | Description
--- | ---
StepDescription | A descriptive, unique name for this step. Use any text.
Snapshot | The name of the snapshot file of the screen state before this step.
ConnectionID | The name of the connection on which this function operates. Do not change the recorded ID. If several connections are open and the ID is not specified, the first connection in the script is used. If only one connection is open, the connection ID is not required.
"WindowTitle=" "WindowTitle/RE=" | The title of the window. The value for Title is a literal string, for example, `"Title=Quality Center"`. If you use WindowTitle/RE, the value is a regular expression, for example, `"WindowTitle/RE=^Document[0-9]+ - Microsoft Word"`.
WindowOrdinal | The 1-based index of the window among the session windows that match the title specified by WindowTitle or WindowTitle/RE. For example, if the WindowTitle/RE and WindowOrdinal arguments are `"WindowTitle/RE=Document[0-9]+ - Microsoft Word"` and `"WindowOrdinal=3"`, the window specified is the third window in the creation order of the existing windows whose title matches the regular expression `"Document[0-9]+ - Microsoft Word"`. If this optional argument is omitted, the default value is 1.
TextX | The horizontal distance in pixels from the left border of the specified window, which corresponds to any point in the text object.
TextY | The vertical distance of the object from the top edge of the window, which corresponds to any point in the text object.
Text | An output parameter for the text.
RDP_LAST | The delimiter marking the end of the argument list.

The rdp_get_text function retrieves the text in the specified point and saves the text to a parameter. The text can later be used for correlations.

This function does not support text in a bitmap format.

This function requires that an RDP agent be installed on the RDP Server.

The rdp_get_text function retrieves the entire text block of the Windows object located at the coordinates specified by the TextX and TextY arguments. This function does not support objects in other applications, such as Java.

## Example

The following retrieves the text of the object located at a specific coordinate. In this example, the text object is the Notepad window, so all text in the Notepad window is saved in a parameter called MyParm.

rdp_get_text(
"StepDescription=Get Text 1",
"Snapshot=snapshot1.inf",
"WindowTitle=Notepad",
"TextX=263",
"TextY=258",
"Text=MyParam",
RDP_LAST );

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: