ctrx_get_text() does not always return text in LoadRunner Citrix Script

ctrx_get_text() does not always return text in LoadRunner Citrix Script

This is about the LoadRunner Citrix protocol, and scripts using "Text Trapping" funcaitons — the feature to read and sync with text.

In some cases if text trapping fails, ctrx_get_text and ctrx_sync_on_text function calls may not return empty result immediately, but may wait until the timeout expires.

It may be possible to work around this with a custom polling implementation, via a loop — and reduced citrix waiting time.

Below is an example:

ctrx_set_waiting_time(2); // reduce the default waiting time for the below loop

{

long iteration = 0;

do {

ctrx_get_text( … );

if (strcmp(buf, “”)) {

break;

}

++iteration;

} while ( iteration < 30 ); // loop, looking for the text to appear

}

ctrx_set_waiting_time(60); // when the text is fetched, increase the wait time

lr_output_message(“text is: %s”, buf);

Advertisements

2 thoughts on “ctrx_get_text() does not always return text in LoadRunner Citrix Script

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s