Example: ctrx_nfuse_connect

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 */
          "URL=http://concept1.mercury.co.il:8080/login.asp", LAST );

     /* Send login information */
          "Method=POST", "EncType=application/x–www–form–urlencoded",
          "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 );

          "URL=http://concept1.mercury.co.il:8080/blank.htm", LAST );
          "URL=http://concept1.mercury.co.il:8080/applist.asp\?NFuse_currentFolder=", LAST );

     /* Connect to Citrix server - this is automatically generated by VuGen */


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


     return 0;