Skip to content

Commit d71a8b1

Browse files
committed
Convert RemoteWebElements decoded from JSON to "known elements".
As of commit e32b83d, the decoded JSON parameters may include a WebElement. It's necessary to convert the element when a RemoteWebElement is passed as the "id" param to SwitchToFrame. Fixes #4083.
1 parent 402f65d commit d71a8b1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

java/server/src/org/openqa/selenium/remote/server/handler/internal/ArgumentConverter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.google.common.collect.Lists;
2323
import com.google.common.collect.Maps;
2424

25+
import org.openqa.selenium.remote.RemoteWebElement;
2526
import org.openqa.selenium.remote.server.KnownElements;
2627

2728
import java.util.List;
@@ -51,6 +52,10 @@ public Object apply(Object arg) {
5152
return converted;
5253
}
5354

55+
if (arg instanceof RemoteWebElement) {
56+
return knownElements.get(((RemoteWebElement) arg).getId());
57+
}
58+
5459
if (arg instanceof List<?>) {
5560
return Lists.newArrayList(Iterables.transform((List<?>) arg, this));
5661
}

0 commit comments

Comments
 (0)