File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
cpp/iedriver/CommandHandlers Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -36,16 +36,23 @@ void SetTimeoutsCommandHandler::ExecuteInternal(
36
36
ParametersMap::const_iterator timeout_parameter_iterator = command_parameters.begin ();
37
37
for (; timeout_parameter_iterator != command_parameters.end (); ++timeout_parameter_iterator) {
38
38
std::string timeout_type = timeout_parameter_iterator->first ;
39
+ if (timeout_type != " implicit" &&
40
+ timeout_type != " script" &&
41
+ timeout_type != " pageLoad" ) {
42
+ response->SetErrorResponse (ERROR_INVALID_ARGUMENT, " Invalid timeout type specified: " + timeout_type);
43
+ return ;
44
+ }
45
+ if (!timeout_parameter_iterator->second .isNumeric ()) {
46
+ response->SetErrorResponse (ERROR_INVALID_ARGUMENT, " Timeout value for timeout type" + timeout_type + " must be an integer" );
47
+ return ;
48
+ }
39
49
timeout = timeout_parameter_iterator->second .asUInt64 ();
40
50
if (timeout_type == " implicit" ) {
41
51
mutable_executor.set_implicit_wait_timeout (timeout);
42
52
} else if (timeout_type == " script" ) {
43
53
mutable_executor.set_async_script_timeout (timeout);
44
54
} else if (timeout_type == " pageLoad" ) {
45
55
mutable_executor.set_page_load_timeout (timeout);
46
- } else {
47
- response->SetErrorResponse (ERROR_INVALID_ARGUMENT, " Invalid timeout type specified: " + timeout_type);
48
- return ;
49
56
}
50
57
}
51
58
}
You can’t perform that action at this time.
0 commit comments