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

[🐛 Bug]: I am getting "WebDriverException: Unable to parse:" when using Selenium Select.selectByVisualText #10489

Closed
mhmelshaaerdxpr opened this issue Mar 29, 2022 · 5 comments
Labels
G-chromedriver Requires fixes in ChromeDriver I-defect I-issue-template Applied to issues not following the template, or missing information. needs-triaging

Comments

@mhmelshaaerdxpr
Copy link

mhmelshaaerdxpr commented Mar 29, 2022

What happened?

I am having a test suite with a parallel setup to run test classes in parallel. The parallel setup is not an issue and it's 100% working fine. After upgrading from selenium 4.0.0-beta-3 to 4.1.2, I often get a WebDriverException: Unable to parse: exception. Every time the exception triggers, the stack trace points to the same line of code that uses Selenium Select.selectByVisualText.

I even tried to run the suite in the serial execution setup and it triggers the same exception with a different test class but referring to the same utility we have that uses the Selenium Select.selectByVisualText

How can we reproduce the issue?

Use the Selenium Select.selectByVisualText to select an option from a drop-down select. I would suggest having a test suite of 10 or so doing the same actions so that you have a higher probability to trigger this exception. Or, maybe one class with a for loop that calls the Select.selectByVisualText method would be easier.

I am not sure if this bug can be resolved without this Feature Proposal being implemented

Relevant log output

WebDriverException: Unable to parse: 
Build info: version: '4.1.2', revision: '9a5a329c5a'
System info: host: '511b4cdd4521', ip: '172.18.0.11', os.name: 'Linux', os.arch: 'amd64', os.version: '5.11.0-1028-azure', java.version: '1.8.0_282'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [eaaeb6cce0ca5a14e5bfdb86fc271b11, findElement {using=xpath, value=//select[@id='edit-moderation-state-0-state']}]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 99.0.4844.74, chrome: {chromedriverVersion: 99.0.4844.51 (d537ec02474b5..., userDataDir: /tmp/.com.google.Chrome.3ghYqB}, goog:chromeOptions: {debuggerAddress: localhost:40463}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, proxy: Proxy(), se:cdp: ws://172.18.0.6:4444/sessio..., se:cdpVersion: 99.0.4844.74, se:vnc: ws://172.18.0.6:4444/sessio..., se:vncEnabled: true, se:vncLocalAddress: ws://172.18.0.6:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}
Session ID: eaaeb6cce0ca5a14e5bfdb86fc271b11
org.openqa.selenium.WebDriverException: Unable to parse: 
Build info: version: '4.1.2', revision: '9a5a329c5a'
System info: host: '511b4cdd4521', ip: '172.18.0.11', os.name: 'Linux', os.arch: 'amd64', os.version: '5.11.0-1028-azure', java.version: '1.8.0_282'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [eaaeb6cce0ca5a14e5bfdb86fc271b11, findElement {using=xpath, value=//select[@id='edit-moderation-state-0-state']}]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 99.0.4844.74, chrome: {chromedriverVersion: 99.0.4844.51 (d537ec02474b5..., userDataDir: /tmp/.com.google.Chrome.3ghYqB}, goog:chromeOptions: {debuggerAddress: localhost:40463}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, proxy: Proxy(), se:cdp: ws://172.18.0.6:4444/sessio..., se:cdpVersion: 99.0.4844.74, se:vnc: ws://172.18.0.6:4444/sessio..., se:vncEnabled: true, se:vncLocalAddress: ws://172.18.0.6:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}
Session ID: eaaeb6cce0ca5a14e5bfdb86fc271b11
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:200)
	at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:133)
	at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:53)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:184)
	at org.openqa.selenium.remote.TracedCommandExecutor.execute(TracedCommandExecutor.java:51)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:558)
	at org.openqa.selenium.remote.ElementLocation$ElementFinder$2.findElement(ElementLocation.java:162)
	at org.openqa.selenium.remote.ElementLocation.findElement(ElementLocation.java:60)
	at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:382)
	at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:374)
	at org.openqa.selenium.support.pagefactory.DefaultElementLocator.findElement(DefaultElementLocator.java:70)
	at org.openqa.selenium.support.pagefactory.internal.LocatingElementHandler.invoke(LocatingElementHandler.java:39)
	at com.sun.proxy.$Proxy14.getDomAttribute(Unknown Source)
	at org.openqa.selenium.support.ui.Select.<init>(Select.java:54)
	at dxpr.testautomation.utility.CommonMethods.selectFromDropDownMenu(CommonMethods.java:163)
	at dxpr.testautomation.pages.DragDropPageCreate.addPage(DragDropPageCreate.java:65)
	at dxpr.testautomation.chrome.ChromeTestBase.createDragDropPage(ChromeTestBase.java:86)
	at dxpr.testautomation.chrome.CarouselOutsideNavigationPositionTopLeftOptionTest.beforeClass(CarouselOutsideNavigationPositionTopLeftOptionTest.java:68)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:133)
	at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:62)
	at org.testng.internal.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:385)
	at org.testng.internal.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:321)
	at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:176)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:122)
	at java.util.ArrayList.forEach(ArrayList.java:1259)
	at org.testng.TestRunner.privateRun(TestRunner.java:794)
	at org.testng.TestRunner.run(TestRunner.java:596)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:377)
	at org.testng.SuiteRunner.access$000(SuiteRunner.java:28)
	at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:418)
	at org.testng.internal.thread.ThreadUtil.lambda$execute$0(ThreadUtil.java:64)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Operating System

Linux runner on GitHub Action.

Selenium version

4.1.2

What are the browser(s) and version(s) where you see this issue?

Chrome headless mode

What are the browser driver(s) and version(s) where you see this issue?

selenium/node-chrome:4.1.2-20220317

Are you using Selenium Grid?

selenium/hub:4.1.2-20220317

@github-actions
Copy link

@mhmelshaaerdxpr, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@pujagani pujagani added the I-issue-template Applied to issues not following the template, or missing information. label Mar 29, 2022
@github-actions
Copy link

Hi, @mhmelshaaerdxpr.
Please follow the issue template, we need more information to reproduce the issue.

Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue.

Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough.

Reply to this issue when all information is provided, thank you.

@titusfortner
Copy link
Member

If you look at the command and stack trace, you'll see it isn't related to the "select by text" part; it is erroring in when trying to find the select element in the first place. I'd have to see the full debug information to know what was being sent back to know what isn't getting parsed. Whatever isn't getting parsed is coming from Chromedriver. Since the Selenium code looks looks correct, then chromedriver is not returning a correct response for some reason.

Few options here.

  1. Maybe the reason has to do with the locator; it's recommended to avoid XPath where possible
  2. Maybe the reason has to do with using headless chrome, try using xvfb instead
  3. Since this intermittent, it most likely it is a timing issue of some kind, so figure out how to wait for the state you need before taking the action
  4. Create a reproducible use case and raise an issue with Google.

@titusfortner titusfortner added the G-chromedriver Requires fixes in ChromeDriver label Mar 29, 2022
@github-actions
Copy link

Hi, @mhmelshaaerdxpr.
This issue has been determined to require fixes in ChromeDriver.

You can see if the feature is passing in the Web Platform Tests.

If it is something new, please create an issue with the ChromeDriver team.
Feel free to comment the issues that you raise back in this issue. Thank you.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
G-chromedriver Requires fixes in ChromeDriver I-defect I-issue-template Applied to issues not following the template, or missing information. needs-triaging
Projects
None yet
Development

No branches or pull requests

3 participants