Skip to content

Commit a83c845

Browse files
committed
Improving error message for findElements in IE driver
1 parent 72760b0 commit a83c845

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

cpp/iedriver/CommandHandlers/FindChildElementCommandHandler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class FindChildElementCommandHandler : public IECommandHandler {
9595

9696
// This code is executed when status_code == ENOSUCHELEMENT
9797
response->SetErrorResponse(status_code,
98-
"Unable to find element with " + mechanism + " == " + value);
98+
"Unable to find element with " + mechanism + " == " + value);
9999
} else {
100100
response->SetErrorResponse(status_code, "Element is no longer valid");
101101
return;

cpp/iedriver/CommandHandlers/FindChildElementsCommandHandler.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ class FindChildElementsCommandHandler : public IECommandHandler {
9797
if (status_code == WD_SUCCESS) {
9898
response->SetSuccessResponse(found_elements);
9999
} else {
100-
response->SetErrorResponse(status_code, "Finding elements returned an unexpected error");
100+
response->SetErrorResponse(status_code,
101+
"Finding elements with " + mechanism + " == " + value +
102+
"returned an unexpected error");
101103
}
102104
} else {
103105
response->SetErrorResponse(status_code, "Element is no longer valid");

cpp/iedriver/CommandHandlers/FindElementCommandHandler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class FindElementCommandHandler : public IECommandHandler {
8383
} while (clock() < end);
8484

8585
response->SetErrorResponse(status_code,
86-
"Unable to find element with " + mechanism + " == " + value);
86+
"Unable to find element with " + mechanism + " == " + value);
8787
return;
8888
}
8989
}

cpp/iedriver/CommandHandlers/FindElementsCommandHandler.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ class FindElementsCommandHandler : public IECommandHandler {
8686
if (status_code == WD_SUCCESS) {
8787
response->SetSuccessResponse(found_elements);
8888
} else {
89-
response->SetErrorResponse(status_code, "Finding elements returned an unexpected error");
89+
response->SetErrorResponse(status_code,
90+
"Finding elements with " + mechanism + " == " + value +
91+
"returned an unexpected error");
9092
}
9193
}
9294
}

0 commit comments

Comments
 (0)