Skip to content

Commit

Permalink
Updating IE driver for allowed commands when alert is present
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jimevans committed Nov 28, 2017
1 parent d5ce210 commit d9fe6e0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cpp/iedriver/IECommandExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,10 @@ void IECommandExecutor::DispatchCommand() {
command_type == webdriver::CommandType::SendKeysToAlert ||
command_type == webdriver::CommandType::AcceptAlert ||
command_type == webdriver::CommandType::DismissAlert ||
command_type == webdriver::CommandType::SetAlertCredentials) {
command_type == webdriver::CommandType::SetAlertCredentials ||
command_type == webdriver::CommandType::GetCurrentWindowHandle ||
command_type == webdriver::CommandType::GetWindowHandles ||
command_type == webdriver::CommandType::SwitchToWindow) {
LOG(DEBUG) << "Alert is detected, and the sent command is valid";
} else {
LOG(DEBUG) << "Unexpected alert is detected, and the sent command is invalid when an alert is present";
Expand Down

0 comments on commit d9fe6e0

Please sign in to comment.