Skip to content
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

unable to pass WebElementFacade to Select class in selenium 4.1.1 #2860

Closed
MohammedWaasim opened this issue Jun 28, 2022 · 6 comments
Closed

Comments

@MohammedWaasim
Copy link

MohammedWaasim commented Jun 28, 2022

Earlier in older version of selenium 3, we were able to pass on WebElementFacade in the Select.
now with serentiy 3.1.15 and selenium 4.1.1 we get below error.
@wakaleo can you please help!

@FindBy(xpath = "//select[contains(@name,'mar')]")
private WebElementFacade maritalStatusSelectField;

final Select ms = new Select(maritalStatSelectField);
ms.selectByVisibleText(text);

java.lang.UnsupportedOperationException: getDomAttribute

at org.openqa.selenium.WebElement.getDomAttribute(WebElement.java:131)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at net.thucydides.core.annotations.locators.AbstractSingleItemHandler.invoke(AbstractSingleItemHandler.java:43)
at com.sun.proxy.$Proxy64.getDomAttribute(Unknown Source)
at org.openqa.selenium.support.ui.Select.<init>(Select.java:54)
@lgermani
Copy link

Are you executing your tests using a Remote driver? like on SauceLabs

@lgermani
Copy link

Seems to be a similar problem as: #2861

@wakaleo
Copy link
Member

wakaleo commented Jun 29, 2022

Could be a dependency conflict.

@MohammedWaasim
Copy link
Author

Could be a dependency conflict.

I referred release page https://github.com/serenity-bdd/serenity-core/releases
and as per that I have pulled the dependencies from maven for serenity and selenium.

For now to over come this issue I am using
selectFromDropdown(maritalStatSelectField,text); //alternatively even this is working maritalStatSelectField.deselectByVisibleText(text);

@MohammedWaasim
Copy link
Author

Are you executing your tests using a Remote driver? like on SauceLabs

no It is failing in local execution only

@wakaleo wakaleo closed this as completed Jun 29, 2022
@wakaleo wakaleo reopened this Jun 29, 2022
@wakaleo
Copy link
Member

wakaleo commented Jun 29, 2022

Duplicate of #2861

@wakaleo wakaleo marked this as a duplicate of #2861 Jun 29, 2022
@wakaleo wakaleo closed this as not planned Won't fix, can't repro, duplicate, stale Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants