Closed ElenaStepuro closed 2 years ago
@ElenaStepuro, thank you for creating this issue. We will troubleshoot it as soon as we can.
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!
First, this error doesn't make sense. If Selenium is getting a return value from find_element()
it isn't going to be a dict
unless something is getting monkey patched somewhere.
I still tried to reproduce with a Selenium server, but this code works fine for me:
options = ChromeOptions()
options.w3c = True
options.add_argument('--no-sandbox')
driver = Remote(
command_executor="http://localhost:4444",
desired_capabilities=DesiredCapabilities.CHROME,
options=options)
driver.get('https://sha-test-app.herokuapp.com/')
element = driver.find_element(By.XPATH, "//button[contains(@class,'default-btn')]")
element.click()
That said, you shouldn't be setting w3c
any longer, or using desired_capabilities
, and you should avoid bypassing the security sandbox unless you've got a good use case for it.
What is running on port 8085
? If a Selenium server, what version? If it's a chromedriver, why not use webdriver.Chrome()
for this instead?
Hello @titusfortner ! I've retried to run code without setting w3c and still has the same exception. On port 8085 I'm running docker container which I have to called during my test run. Forget to add while opening this issue: on port 8086 I'm running container which used Selenium Grid 4.0.0-rc-1
I encountered a similar problem during the use of Appium,
At this time, find_elenment returned a dict instead of a WebElement.
Unfortunately I cannot reproduce this problem,
Can you print out the return value of find_element, @ElenaStepuro ? Or maybe provide an environment for others to try ?I'm afraid it's not accidental,
Oh, this makes sense, this is the JSON Wire Protocol signature for elements. You aren't getting a w3c response from the driver.
Hello @dongfangtianyu ! This is what findElement returns
Somehow you are getting a jwp session. It should default to w3c, so you're doing something weird.
Appium is slightly harder to get a w3c session.
What is standard out on your console?
I can duplicate this error by setting:
options.add_experimental_option('w3c', False)
@ElenaStepuro send the exact code you are using, and the console output from the grid. Something it is seeing wants to toggle JSON Wire Protocol, which should not be happening with what you've provided, so something is missing
@dongfangtianyu Getting w3c compliant Appium session is a little trickier. You can see an example of valid w3c here: https://saucelabs.com/platform/platform-configurator#/
Since this is user setting issues and not a problem with Selenium code, I'm closing this. If people need additional assistance, you can @
me here, contact us in Chat
I had the same error. For me the solution was to update the chromedriver to latest version
yeap, me too
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.
What happened?
During running tests on Python faced with issue: AttributeError: 'dict' object has no attribute 'click' which didn't see on Selenium 3.141
How can we reproduce the issue?
Relevant log output
Operating System
Windows 10
Selenium version
4.0.0 and 4.1.0
What are the browser(s) and version(s) where you see this issue?
Chrome 94, 95, 96
What are the browser driver(s) and version(s) where you see this issue?
Remote
Are you using Selenium Grid?
No