
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
The type of dialogs these dlg functions relate to are normally generated client side (file chooser, alerts, ok button for example) and usually they are immediate as long as the machine isn't running really slowly.
For other types of dialogs like new windows or popups, SP should sync these automatically provided it can detect the traffic and events that it performs sync on, although there are circumstances where this doesn't work and manual sync is required. In such a scenario Don's advice is correct.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content