-
Notifications
You must be signed in to change notification settings - Fork 764
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
Execute JavaScript converts arguments to strings with robot==6.1 #1843
Comments
Without testing it, but reading the type hint of that keyword and its code, i would say, that the type hint of Python Selenium docs do say for
So there should not be any type hint it can be Ps: i am again really disappointed by the docs of Selenium itself. selenium.dev does not mention how to use args at all and even readthedocs is absolutely too lean here. However: in the end they are just calling
|
As the mentioned already in the description, this keyword has wrong type hints. The reason it causes issues in RF 6.1 but not earlier is: Using |
Its not only the error message, but more importantly the documentation of the types accepted. |
Fixed with #1866. |
Steps to reproduce the issue
Expected behavior and actual behavior
When I run this robot script using robot==6.1 I see the browser window with alert message box saying:
{"0":"{'key': 'value'}"}
I was expecting to see a dictionary value that seleniumlibrary with robot==6.0.2 produced
{"0":{"key":"value"}}
Notice that currently I see a string with python representation of the dict and previously it was a dict itself.
Hint: this happens because the type hint in this line insists on WebElements and strings:
SeleniumLibrary/src/SeleniumLibrary/keywords/javascript.py
Line 33 in 9823418
Robot 6.1 seems to use type hints for automatic type conversions.
Environment
Browser: Chrome (latest)
Operating System: Mac OS 13.4.1
Libraries
The text was updated successfully, but these errors were encountered: