Issue launching Citrix application during recording, using Multi Web+Citrix_ICA script.

Issue launching Citrix application during recording, using Multi Web+Citrix_ICA script.

While recording an application published in the Citrix Web Interface — when the application icon is clicked, the application may either not launch, or the IE browser may "silently disappear" and no application will be presented.

VuGen may or may not exit.

The application can be recorded using an ICA file as a single-protocol ICA script, and the Web-based portion of the business process prior to the Citrix application icon being clicked can be recorded as well without issue using a Web http/html or Web http/html + Citrix ICA script.

It has been determined already that the standard checks have been already done — for example, that Microsoft Data Execution Prevention (DEP) is disabled, and hyperthreading (if enabled) is disabled, and that security software is disabled as much as possible, as well that the Citrix server and Citrix Client and Citrix versions and client and Citrix server platform/OS releases are supported by LoadRunner.

In this situation, it may not be possible to completely disable the security software ; with no exception dialog seen, nor windows event logs showing any hints as to why IE and/or the AUT and/or VuGen has disappeared, there is little evidence to prove what is at fault.

This is most likely caused by anti-malware or anti-virus software, for example, Cisco Personal Firewall, or McAffee.

When recording a Web http/html script, VuGen used "injection" hooking techniques to instrument the application under test (AUT). These mechanisims may lead the anti-virus/anti-malware software to believe the browser and/or VuGen or the AUT has been compromised, and the security software may "silently close" the AUT, the IE browser trying to launch the AUT, and/or VuGen itself.

Oppositely, recording a single-protocol Citrix ICA protocol uses a completely different technique — implementing the Citrix APIs ; in this case, the hooking technique is not needed.

The workaround involves creating two recordings/scripts:

– A Web HTTP/HTML single-protocol script to record the Web portion of the business process and to dynamically capture the ICA file which comes back from the server in a response to a request.

– A Citrix ICA Single-protocol script to record the ICA portion of the business process, implementing the dynamically-captured ICA file.

The recorded scripts are joined together and the code is modified, to dynamically capture the ICA file and to then use it to connect to the AUT and to exercise the Business Process.

This workaround avoids the recording issue in the Web portion, and allows an ICA file to be downloaded dynamically from the server to the client each time it runs, as would be the case if this issue did not exist.

NOTE: For purposes of this demo, this solution demonstrates all of the code being recorded into the Action() block. You may want to arrange your code differently.

1. Create a Web http/html script, and record the business process including the click on the icon of the published Citrix application. Since this script does not include ICA, the Citrix AUT will not launch.

2. Stop the recording, and add these two variable declarations at the top of the Action() block:

Action()
{
int fp;
char * icafile;

3. In the recorded script, near the end, you should find a statement similar to this which is the result of your click on the application icon (note this script used URL-mode, yours may be different):

web_url("launcher.aspx",
"URL=http://myCitrixServer.com/Citrix/AccessPlatform/site/launcher.aspx?NFuse_Application=Citrix.MPS.App.PCFARM.Calc_Virtpc1&LaunchId=1259608978284",
"TargetFrame=",
"Resource=1",
"RecContentType=application/x-ica",
"Referer=http://myCitrixServer.com/Citrix/AccessPlatform/site/applist.aspx",
"Snapshot=t6.inf",
LAST);

4. Add this code above the web_url in step 3 above, to capture the ICA file resulting from the request:

web_reg_save_param("icadata", "LB=WFClient", "RB=", LAST);

5.Add this code below the web_url() to save the ICA file to a local disk:

icafile = (char *)malloc(strlen(lr_eval_string(" {icadata}")) + 100);
sprintf(icafile,"[WFClient%s",lr_eval_string("{icadata}"));
fp = fopen("C:\\\icafile.ica", "w");
fprintf(fp, icafile);
fclose(fp);

6. The completed code should look like this:

Action()
{
int fp;
char * icafile;

// …
// … Other recorded code removed to improve clarity of this KB
// …

web_reg_save_param("icadata", "LB=WFClient", "RB=", LAST); // Added: will save the returned ICA file data in a parameter

web_url("launcher.aspx", // As-recorded ; this results from clicking the application icon
"URL=http://myCitrixServer.com/Citrix/AccessPlatform/site/launcher.aspx?NFuse_Application=Citrix.MPS.App.FARM.Calc&LaunchId=1259608978284",
"TargetFrame=",
"Resource=1",
"RecContentType=application/x-ica",
"Referer=http://myCitrixServer.com/Citrix/AccessPlatform/site/applist.aspx",
"Snapshot=t6.inf",
LAST);

// code below saves the parameter data onto the local C:\ drive, as an ICA file.

icafile = (char *)malloc(strlen(lr_eval_string(" {icadata}")) + 100);
sprintf(icafile,"[WFClient%s",lr_eval_string("{icadata}"));
fp = fopen("C:\\\icafile.ica", "w");
fprintf(fp, icafile);
fclose(fp);

return 0;
}

7. Replay the modified script, which will save the ICA file to the local disk.

NOTE: You will next use this ICA file to record the Citrix ICA portion of your script. Ensure any errors are resolved before moving on.

8. Edit the saved ICA file with a text editor, removing the line "RemoveICAFile=yes" from the ICA file, if it is present. Save the ICA file, exit the editor.

9. Ensure you can use this ICA file to launch your Citrix AUT (outside of VuGen). If your Citrix Program Neighborhood ICA client is installed properly, you should be able to double-click on this ICA file with Windows Explorer to launch this Citrix application.

10. Next, create a new, single-protocol Citrix ICA script. In the recording options, use this ICA file saved earlier, and record the complete Citrix portion of your Business Process.

11. After recording the Citrix ICA portion, stop recording and examine the script. In the Action() block, you will see reference to the ICA file in the ctrx_set_connect_opt() call:

ctrx_set_connect_opt(ICAFILE,"C:\\\icafile.ica"); // this is the ICA file you captured to disk.
ctrx_wait_for_event("LOGON", CTRX_LAST);
lr_think_time(5);

//The code below is just a simple example, an AUT being launched and exited.
//Your Citrix Business Process recording may produce more code.

ctrx_sync_on_window("Calculator", ACTIVATE, 88, 88, 261, 253, "snapshot1", CTRX_LAST);
ctrx_obj_mouse_click("<class=SciCalc >", 249, 8, LEFT_BUTTON, 0, "Calculator=snapshot2", CTRX_LAST);
ctrx_disconnect_server("”ô\x12", CTRX_LAST);
return 0;
}

12. Ensure this Citrix portion of your business process replays properly before proceeding.

13. Now, create a new Citrix ICA + Web http/html multi-protocol script.

14. Copy the Web HTTP/HTML script you replayed to capture the ICA file — into the top of the Action block.

15. Copy the Citrix ICA script code you recorded in the Citrix part, appending it to the end of the Action block (note : the full example not included here for simplicity).

16. Replay this script ensuring it replays successfully. Each time the script runs, it should dynamically download the ICA file to disk.

NOTE: If the merged Web+Citrix ICA script fails during replay with the following error immediatly:

Error: Failed to get window size, wrong format.
Citrix client replay version 11.0.0.5357 , record version
Warning: Extension CitrixClientImpl.dll reports error -1 on call to function ExtPerThreadInitialize
Error: Vuser failed to initialize extension CitrixClientImpl.dll.
Vuser Terminated.

Advertisements

5 thoughts on “Issue launching Citrix application during recording, using Multi Web+Citrix_ICA script.

  1. urs

    hi there,
    i have exactly the error you mentioned in the NOTE part. what do i have to do to get the script working?

    regards

    Reply
  2. Morten

    Nice desription!

    I got the error descriped in the last Note:

    >>NOTE: If the merged Web+Citrix ICA script fails during replay with the following error >>immediatly:
    >>
    >>Error: Failed to get window size, wrong format.
    >>Citrix client replay version 11.0.0.5357 , record version
    >>Warning: Extension CitrixClientImpl.dll reports error -1 on call to function >>ExtPerThreadInitialize
    >>Error: Vuser failed to initialize extension CitrixClientImpl.dll.
    >>Vuser Terminated.

    But I can’t solve it! Hope someone can give me a hint 🙂

    Reply
  3. Misha

    Check if your default.cfg file in your script has following:

    [Citrix]
    Latency=Use Server Default
    Compression=1
    Cache=0
    Queue=0
    Sound=Use Server Default
    BitmapSyncLevel=Exact

    NOTE: Notice above that the Citrix section is all lower case. The above section is incorrect. Replace the entire citrix section with the following:

    [CITRIX]
    DesktopColors=16
    Colors=High Color (16 bit)
    Enctyption=Use Server Default
    Window=800 x 600

    NOTE: Ensure there is not both a “[CITRIX]” and “[Citrix]” section! The only section that should be present is the above “[CITRIX]” section!

    Reply

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