Controlling script execution for browser dialogs (BrowserWaitForDlg?)

Is there a way to tell Silk Performer to wait for a dialog box to appear? I find myself working in a rich web environment with quite a few spawned dialogs that I have to test for and work around.

Parents
  • Verified Answer

    This is the most common way I know of to wait/sync on objects.  Replace locator with what you are waiting for and replace other code to exit after some timeout period etc.

    while (BrowserFind(HANDLE_DESKTOP , "//DIV[@textContents='Processing request.']", false, 0, true) <> HANDLE_INVALID) do

    wait(5.0);

    // ThinkTime(10.0, OPT_THINKTIME_FORCEEXACT);  <<<  alternative to WAIT that will register the user as "active" during an actual test run. - dbonin 7/20/2015

    loop_counter := (loop_counter 5); //inc the counter by 5 seconds

    //check the loop counter and exit if we have waited more than MAX_WAIT_MINUTES minutes

    if ((loop_counter/60) > MAX_WAIT_MINUTES) then

    RaiseError(0, " ... <something> took too long - aborting after waiting " STRING(MAX_WAIT_MINUTES) " minutes", SEVERITY_TRANS_EXIT );

    end;

    end;

Reply
  • Verified Answer

    This is the most common way I know of to wait/sync on objects.  Replace locator with what you are waiting for and replace other code to exit after some timeout period etc.

    while (BrowserFind(HANDLE_DESKTOP , "//DIV[@textContents='Processing request.']", false, 0, true) <> HANDLE_INVALID) do

    wait(5.0);

    // ThinkTime(10.0, OPT_THINKTIME_FORCEEXACT);  <<<  alternative to WAIT that will register the user as "active" during an actual test run. - dbonin 7/20/2015

    loop_counter := (loop_counter 5); //inc the counter by 5 seconds

    //check the loop counter and exit if we have waited more than MAX_WAIT_MINUTES minutes

    if ((loop_counter/60) > MAX_WAIT_MINUTES) then

    RaiseError(0, " ... <something> took too long - aborting after waiting " STRING(MAX_WAIT_MINUTES) " minutes", SEVERITY_TRANS_EXIT );

    end;

    end;

Children
No Data