Skip to content

Commit 13d8f8b

Browse files
committed
Properly initializing JSON values in IE driver
Fixes issue #5519.
1 parent d7fe2c4 commit 13d8f8b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cpp/iedriver/CommandHandlers/NewSessionCommandHandler.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ Json::Value NewSessionCommandHandler::ProcessCapabilities(const IECommandExecuto
300300
LOG(DEBUG) << "Processing matched capability set with index " << i;
301301
IECommandExecutor& mutable_executor = const_cast<IECommandExecutor&>(executor);
302302

303-
Json::Value unexpected_alert_behavior = this->GetCapability(merged_capabilities, UNHANDLED_PROMPT_BEHAVIOR_CAPABILITY, Json::stringValue, "");
303+
Json::Value unexpected_alert_behavior = this->GetCapability(merged_capabilities, UNHANDLED_PROMPT_BEHAVIOR_CAPABILITY, Json::stringValue, Json::Value(Json::stringValue));
304304
mutable_executor.set_unexpected_alert_behavior(unexpected_alert_behavior.asString());
305305

306306
Json::Value page_load_strategy = this->GetCapability(merged_capabilities, PAGE_LOAD_STRATEGY_CAPABILITY, Json::stringValue, NORMAL_PAGE_LOAD_STRATEGY);
@@ -367,7 +367,7 @@ void NewSessionCommandHandler::SetBrowserFactorySettings(const IECommandExecutor
367367
Json::Value ignore_zoom_setting = this->GetCapability(capabilities, IGNORE_ZOOM_SETTING_CAPABILITY, Json::booleanValue, false);
368368
factory_settings.ignore_zoom_setting = ignore_zoom_setting.asBool();
369369

370-
Json::Value browser_attach_timeout = this->GetCapability(capabilities, BROWSER_ATTACH_TIMEOUT_CAPABILITY, Json::intValue, 0);
370+
Json::Value browser_attach_timeout = this->GetCapability(capabilities, BROWSER_ATTACH_TIMEOUT_CAPABILITY, Json::intValue, Json::Value(Json::intValue));
371371
factory_settings.browser_attach_timeout = browser_attach_timeout.asInt();
372372

373373
Json::Value initial_url = this->GetCapability(capabilities, INITIAL_BROWSER_URL_CAPABILITY, Json::stringValue, default_initial_url);
@@ -379,7 +379,7 @@ void NewSessionCommandHandler::SetBrowserFactorySettings(const IECommandExecutor
379379
Json::Value force_shell_windows_api = this->GetCapability(capabilities, FORCE_SHELL_WINDOWS_API_CAPABILITY, Json::booleanValue, false);
380380
factory_settings.force_shell_windows_api = force_shell_windows_api.asBool();
381381

382-
Json::Value browser_command_line_switches = this->GetCapability(capabilities, BROWSER_COMMAND_LINE_SWITCHES_CAPABILITY, Json::stringValue, "");
382+
Json::Value browser_command_line_switches = this->GetCapability(capabilities, BROWSER_COMMAND_LINE_SWITCHES_CAPABILITY, Json::stringValue, Json::Value(Json::stringValue));
383383
factory_settings.browser_command_line_switches = browser_command_line_switches.asString();
384384

385385
Json::Value ensure_clean_session = this->GetCapability(capabilities, ENSURE_CLEAN_SESSION_CAPABILITY, Json::booleanValue, false);
@@ -444,13 +444,13 @@ void NewSessionCommandHandler::SetInputSettings(const IECommandExecutor& executo
444444
Json::Value enable_native_events = this->GetCapability(capabilities, NATIVE_EVENTS_CAPABILITY, Json::booleanValue, true);
445445
input_manager_settings.use_native_events = enable_native_events.asBool();
446446

447-
Json::Value scroll_behavior = this->GetCapability(capabilities, ELEMENT_SCROLL_BEHAVIOR_CAPABILITY, Json::intValue, 0);
447+
Json::Value scroll_behavior = this->GetCapability(capabilities, ELEMENT_SCROLL_BEHAVIOR_CAPABILITY, Json::intValue, Json::Value(Json::intValue));
448448
input_manager_settings.scroll_behavior = static_cast<ElementScrollBehavior>(scroll_behavior.asInt());
449449

450450
Json::Value require_window_focus = this->GetCapability(capabilities, REQUIRE_WINDOW_FOCUS_CAPABILITY, Json::booleanValue, false);
451451
input_manager_settings.require_window_focus = require_window_focus.asBool();
452452

453-
Json::Value file_upload_dialog_timeout = this->GetCapability(capabilities, FILE_UPLOAD_DIALOG_TIMEOUT_CAPABILITY, Json::intValue, 0);
453+
Json::Value file_upload_dialog_timeout = this->GetCapability(capabilities, FILE_UPLOAD_DIALOG_TIMEOUT_CAPABILITY, Json::intValue, Json::Value(Json::intValue));
454454
if (file_upload_dialog_timeout.asInt() > 0) {
455455
mutable_executor.set_file_upload_dialog_timeout(file_upload_dialog_timeout.asInt());
456456
}

0 commit comments

Comments
 (0)