Example: ctrx_set_window

In the following example, after connecting to the Citrix server ludens, ctrx_set_window waits for the window of Microsoft's Internet Explorer. Internet Explorer's home page is the Mercury Interactive site, so the string "Mercury Interactive Corporation at mercuryinteractive.com" appears in the header frame of the window. When the window appears, the code then continues with the next statement, ctrx_mouse_click.

Actions () {

     ctrx_connect_server("ludens", "test", "test", "ludens");
     ctrx_wait_for_event("LOGON");

     /* Launch the web browser by clicking on desktop IE icon */
     ctrx_mouse_double_click(34, 325, LEFT_BUTTON, 0, NULL);
     lr_think_time(13);
     ctrx_set_window(
               "Mercury Interactive Corporation at mercuryinteractive.com");

     /* Exit the web browser by clicking on top left Exit check box */
     ctrx_mouse_click(573, 61, LEFT_BUTTON, 0,
               "Mercury Interactive Corporation at mercuryinteractive.com");
     ctrx_unset_window(
              "Mercury Interactive Corporation at mercuryinteractive.com");

     lr_think_time(12);
     ctrx_disconnect_server("ludens");

     return 0;
}