Skip to content

Commit ad7c6b6

Browse files
committed
Adopt changes from SeleniumHQ/selenium#15884
Fixes #11
1 parent aede7b8 commit ad7c6b6

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 1.0.3
2+
* Removed reflection calls in ``CustomizableJsonToWebElementConverter`` as https://github.com/SeleniumHQ/selenium/issues/15884 was fixed #11
3+
* Selenium version 4.34+ is required
4+
* Updated dependencies
5+
16
# 1.0.2
27
* ``ImprovedRemoteWebElement``
38
* Make it possible to disable auto scroll

selenium-elements/src/main/java/software/xdev/selenium/elements/remote/CustomizableRemoteWebElementInstaller.java

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,39 +51,20 @@ public static void install(
5151

5252
public static class CustomizableJsonToWebElementConverter extends JsonToWebElementConverter
5353
{
54-
// Can be removed once https://github.com/SeleniumHQ/selenium/issues/15884 is fixed
55-
private final Method mSetOwner;
5654
private final Supplier<RemoteWebElement> remoteWebElementSupplier;
5755

5856
public CustomizableJsonToWebElementConverter(
5957
final RemoteWebDriver driver,
6058
final Supplier<RemoteWebElement> remoteWebElementSupplier)
6159
{
6260
super(driver);
63-
64-
try
65-
{
66-
this.mSetOwner = JsonToWebElementConverter.class.getDeclaredMethod("setOwner", RemoteWebElement.class);
67-
this.mSetOwner.setAccessible(true);
68-
}
69-
catch(final NoSuchMethodException ex)
70-
{
71-
throw new IllegalStateException("Failed to find setOwner", ex);
72-
}
7361
this.remoteWebElementSupplier = remoteWebElementSupplier;
7462
}
7563

7664
@Override
7765
protected RemoteWebElement newRemoteWebElement()
7866
{
79-
try
80-
{
81-
return (RemoteWebElement)this.mSetOwner.invoke(this, this.remoteWebElementSupplier.get());
82-
}
83-
catch(final IllegalAccessException | InvocationTargetException e)
84-
{
85-
throw new IllegalStateException("Failed to call setOwner", e);
86-
}
67+
return this.setOwner(this.remoteWebElementSupplier.get());
8768
}
8869
}
8970

0 commit comments

Comments
 (0)