Share this page

# ctrx_nfuse_connect

Example | Connection Functions

Connects to a Citrix server via an NFUSE portal.

`int ctrx_nfuse_connect( char *url , [CONTINUE_ON_ERROR,] CTRX_LAST );`

url | The NFUSE ICA file's resource url. Note: If the machine that hosts the Citrix server (Citrix Virtual Apps and Desktop) is associated with a CNAME/alias, make sure that the url argument receives the hostname used by the Citrix server.
CONTINUE_ON_ERROR | A constant, entered as shown without quotes. Overrides the error behavior runtime setting for this step so that script behaves as though the runtime setting was Continue on error.
CTRX_LAST | A marker that indicates the end of the argument list.

ctrx_nfuse_connect establishes a connection with the Citrix server using the NFUSE application portal. Specifications found in the ICA file defining the personalized specifications of the NFUSE portal are downloaded from the server, after which the connection is made.

ctrx_nfuse_connect is automatically generated by VuGen when recording an NFUSE session.

Note: Before recording NFUSE sessions, you must enable multi-protocol recording. See "About Creating Citrix Vuser Scripts" in the Virtual User Generator Help Center.

## Return Values

Citrix ICA Return Values

## Parameterization

No parameterization is available for this function.

## Example

The following example uses ctrx_nfuse_connect to establish a connection to the Citrix server. After filling in the login information at the NFUSE portal, ctrx_nfuse_connect is automatically generated by VuGen to retrieve information from the server (found in the ICA file) on applications available to the client. In this case, Microsoft's Excel application is configured to launch automatically.

After ctrx_nfuse_connect connects to the server, the code waits for the Excel window to appear before continuing the session.

    vuser_init () {

         /* Use browser to connect to NFUSE portal */
         web_url("login.asp",
              "URL=http://concept1.mycomp.com:8080/login.asp", LAST );

         /* Send login information */
          web_submit_data("frameset.asp",
              "Action=http://concept1.mycomp.com:8080/frameset.asp",
              "Method=POST", "EncType=application/x–www–form–urlencoded",
              ITEMDATA,
              "Name=user", "Value=test", ENDITEM,
              "Name=password", "Value=test", ENDITEM,
              "Name=loginPage", "Value=default", ENDITEM,
              "Name=domain", "Value=ludens", ENDITEM,
              "Name=logIn.x", "Value=46", ENDITEM,
              "Name=logIn.y", "Value=14", ENDITEM, LAST );

         web_url("blank.htm",
              "URL=http://concept1.mycomp.com:8080/blank.htm", LAST );
         web_url("applist.asp",
              "URL=http://concept1.mycomp.com:8080/applist.asp\?NFuse_currentFolder=", LAST );

         /* Connect to Citrix server - this is automatically generated by VuGen */
         ctrx_nfuse_connect("http://concept1.mycomp.com:8080/launch.asp\?NFuse_Application=Ex0078cel&NFuse_MIMEExtension=.ica", CTRX_LAST);

         ctrx_wait_for_event("LOGON");

         /* Now wait for Excel application defined in NFUSE ICA file */
         ctrx_set_window("Microsoft Excel", CTRX_LAST);
         ctrx_mouse_click(249, 32, LEFT_BUTTON, 0, "Microsoft Excel", CTRX_LAST);
         ctrx_mouse_click(508, 80, LEFT_BUTTON, 0, "Microsoft Excel", CTRX_LAST);
         ctrx_set_window("Microsoft Excel_2", CTRX_LAST);
         ctrx_mouse_click(416, 356, LEFT_BUTTON, 0, "Microsoft Excel", CTRX_LAST);
         ctrx_unset_window("Microsoft Excel_2", CTRX_LAST);
         lr_think_time(2);
         ctrx_mouse_click(158, 570, LEFT_BUTTON, 0, "Microsoft Excel", CTRX_LAST);
         lr_think_time(1);

         ctrx_disconnect_server("", CTRX_LAST);

         return 0;
    }

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: