The Wait Until * keywords don't support a None value for the error parameter
See original GitHub issueSteps to reproduce the issue
*** Settings ***
Library SeleniumLibrary
*** Test Cases ***
Test
Open Browser url=https://github.com/ browser=Chrome
Run Keyword And Expect Error Element * not visible after *
... Wait Until Element Is Visible locator=xpath://div[@id="nosuchelement"] timeout=200 milliseconds
# the previous call passes, the following - not:
Run Keyword And Expect Error Element * not visible after *
... Wait Until Element Is Visible locator=xpath://div[@id="nosuchelement"] timeout=200 milliseconds error=${None}
# the failure is
# Expected error 'Element * not visible after *' but got 'None'.
[Teardown] Close Browser
Error messages and additional information
The issue is applicable to all wait_until_*()
methods in the keywords\waiting.py
file; apparently the type hinting makes Robot Framework itself to cast the value to str - once the value is passed as a method argument, it’s already a string.
Expected behavior and actual behavior
Passing a ${None}
argument to error
should be equivalent as not setting a value at all, leaving it to default. But it’s actually substituted with the string representation, e.g. "None"
Attempted workarounds
Changing the hint to Union[str, None]
, Union[None, str]
- no luck, still the same unexpected behavior.
Environment
Browser: Not important (reproduced with Chrome v91.0.4472.77) Browser driver: Not important (reproduced with chromedriver v91.0.4472.19) Operating System: Win 10, AWS Linux, Ubuntu 18.04 Libraries
- Robot Framework: 4.0.3
- Selenium: 3.141.0
- SeleniumLibrary: 5.1.3
- Interpreter: py3.7.8
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
RF version 4 and above:Suspended due to logged failure ...
In RF version 4 and above, I am getting exception when using "Wait Until Page ... Argument 'timeout' got value '0.5s' that cannot...
Read more >"Wait Until Keyword Succeeds" doesn't execute the whole ...
In case there is an issue with the read text, I used a simple string. Only 'Robot is nor working' appears on the...
Read more >BuiltIn - Robot Framework
Keywords verifying something that allow dropping actual and expected values from the possible error message also consider string no values to be ...
Read more >argparse — Parser for command-line options, arguments and ...
The module will also issue errors when users give the program invalid ... It supports positional arguments, options that accept values, and on/off...
Read more >KEYWORDS — robotframework-jupyterlibrary 0.4.1 ...
timeout : Default value for timeouts used with Wait ... keywords. ... See Selenium API documentation for details about the supported arguments. Examples: ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If type is
Union[str, None]
, stringNone
isn’t converted because the type allows strings.I can take a look, most likely this week.