File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
cpp/iedriver/CommandHandlers Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -56,11 +56,17 @@ void ClearElementCommandHandler::ExecuteInternal(
56
56
// does not return the proper error code when this error condition is encountered.
57
57
// Thus, we'll check the interactable and editable states of the element before
58
58
// attempting to clear it.
59
- if (!element_wrapper->IsInteractable () || !element_wrapper->IsEditable ()) {
60
- response->SetErrorResponse (EELEMENTNOTENABLED,
61
- " Element must not be hidden, disabled or read-only" );
59
+ if (!element_wrapper->IsEditable () || !element_wrapper->IsEnabled ()) {
60
+ response->SetErrorResponse (ERROR_INVALID_ELEMENT_STATE,
61
+ " Element must not be read-only or disabled" );
62
+ return ;
63
+ }
64
+ if (!element_wrapper->IsInteractable ()) {
65
+ response->SetErrorResponse (ERROR_ELEMENT_NOT_INTERACTABLE,
66
+ " Element is not interactable, it must not be hidden and it must be able to receive focus" );
62
67
return ;
63
68
}
69
+
64
70
// The atom is just the definition of an anonymous
65
71
// function: "function() {...}"; Wrap it in another function so we can
66
72
// invoke it with our arguments without polluting the current namespace.
You can’t perform that action at this time.
0 commit comments