Skip to content

feat: Proxy commands issues via RemoteWebElement #2311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jul 3, 2025
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,24 @@ public Object call(Object obj, Method method, Object[] args, Callable<?> origina
Object result = original.call();

if (result instanceof RemoteWebElement) {
result = wrapElement(
return wrapElement(
(RemoteWebElement) result,
parent,
listeners);
} else if (result instanceof List) {
List<?> originalList = (List<?>) result;

if (!originalList.isEmpty()) {
result = originalList.stream()
.map(item -> {
if (item instanceof RemoteWebElement) {
return wrapElement(
(RemoteWebElement) item,
parent,
listeners);
}
return item;
})
.collect(Collectors.toList());
}
}

if (result instanceof List) {
return ((List<?>) result).stream()
.map(item -> {
if (item instanceof RemoteWebElement) {
return wrapElement(
(RemoteWebElement) item,
parent,
listeners);
}
return item;
})
.collect(Collectors.toList());
}

return result;
Expand Down
Loading