Skip to content

Commit d9fe6e0

Browse files
committed
Updating IE driver for allowed commands when alert is present
The W3C WebDriver Specification allows getting the current window handles, the list of currently available window handles, and switching to a window (in certain cases) while an alert is present. This commit now allows the IE driver to do so without throwing an UnexpectedAlertException.
1 parent d5ce210 commit d9fe6e0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cpp/iedriver/IECommandExecutor.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,10 @@ void IECommandExecutor::DispatchCommand() {
474474
command_type == webdriver::CommandType::SendKeysToAlert ||
475475
command_type == webdriver::CommandType::AcceptAlert ||
476476
command_type == webdriver::CommandType::DismissAlert ||
477-
command_type == webdriver::CommandType::SetAlertCredentials) {
477+
command_type == webdriver::CommandType::SetAlertCredentials ||
478+
command_type == webdriver::CommandType::GetCurrentWindowHandle ||
479+
command_type == webdriver::CommandType::GetWindowHandles ||
480+
command_type == webdriver::CommandType::SwitchToWindow) {
478481
LOG(DEBUG) << "Alert is detected, and the sent command is valid";
479482
} else {
480483
LOG(DEBUG) << "Unexpected alert is detected, and the sent command is invalid when an alert is present";

0 commit comments

Comments
 (0)