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

     /* Send login information */
      web_submit_data("frameset.asp",
          "Action=http://concept1.mercury.co.il: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.mercury.co.il:8080/blank.htm", LAST );
     web_url("applist.asp",
          "URL=http://concept1.mercury.co.il:8080/applist.asp\?NFuse_currentFolder=", LAST );

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

     ctrx_wait_for_event("LOGON");

     /* 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");
     lr_think_time(2);
     ctrx_mouse_click(158, 570, LEFT_BUTTON, 0, "Microsoft Excel");
     lr_think_time(1);

     ctrx_disconnect_server("");

     return 0;
}