MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / IsAlertActive

Method IsAlertActive

cpp/iedriver/IECommandExecutor.cpp:1209–1230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1207}
1208
1209bool IECommandExecutor::IsAlertActive(BrowserHandle browser, HWND* alert_handle) {
1210 LOG(TRACE) << "Entering IECommandExecutor::IsAlertActive";
1211 HWND dialog_handle = browser->GetActiveDialogWindowHandle();
1212 if (dialog_handle != NULL) {
1213 // Found a window handle, make sure it's an actual alert,
1214 // and not a showModalDialog() window.
1215 std::vector<char> window_class_name(34);
1216 ::GetClassNameA(dialog_handle, &window_class_name[0], 34);
1217 if (strcmp(ALERT_WINDOW_CLASS, &window_class_name[0]) == 0) {
1218 *alert_handle = dialog_handle;
1219 return true;
1220 } else if (strcmp(SECURITY_DIALOG_WINDOW_CLASS, &window_class_name[0]) == 0) {
1221 *alert_handle = dialog_handle;
1222 return true;
1223 } else {
1224 LOG(WARN) << "Found alert handle does not have a window class consistent with an alert";
1225 }
1226 } else {
1227 LOG(DEBUG) << "No alert handle is found";
1228 }
1229 return false;
1230}
1231
1232bool IECommandExecutor::HandleUnexpectedAlert(BrowserHandle browser,
1233 HWND alert_handle,

Callers 4

OnBrowserCloseWaitMethod · 0.95
OnSessionQuitWaitMethod · 0.95
OnScriptWaitMethod · 0.95
DispatchCommandMethod · 0.95

Calls 2

LOGClass · 0.50

Tested by

no test coverage detected