Describe the bug
Keywords which use internally the decorator QWeb.internal.decorators.timeout_decorator raise exception QWebElementNotFoundError("Use \\= instead of = in xpaths") when giving the first argument as a named argument
For example (https://duckduckgo.com/ search text input)
Click Element //input[@id\="search_form_input_homepage"] works when = characters of the xpath are escaped
Click Element xpath=//input[@id="search_form_input_homepage"] will not work
Click Element xpath=//input[@id\="search_form_input_homepage"] will not work even with escaped xpath
But Is Element which is not decorated by timeout_decorator accepts xpath as named argument.
As unnamed arg the = characters of xpath need to be escaped as expected
Is Element xpath=//input[@id="search_form_input_homepage" works
Is Element //input[@id\="search_form_input_homepage" works
Is Element //input[@id="search_form_input_homepage" does not work (expected not to work)
Bug originates from method QWeb.internal.decorators._equal_sign_handler(args, kwargs, function_name)
To Reproduce
Create a following rf test and run it
*** Settings ***
Library QWeb
Suite Setup OpenBrowser https://duckduckgo.com chrome
Suite Teardown Close All Browsers
*** Test Cases ***
Escaped named arg fails
Click Element xpath=//input[@id\="search_form_input_homepage"]
Unescaped named arg fails
Click Element xpath=//input[@id="search_form_input_homepage"]
Escaped unnamed arg passes
Click Element //input[@id\="search_form_input_homepage"]
Not decorated named arg passes
Is Element xpath=//input[@id="search_form_input_homepage"
Not decorated unescaped unnamed arg fails
Is Element //input[@id="search_form_input_homepage"
Not decorated escaped unnamed arg passes
Is Element //input[@id\="search_form_input_homepage"
Expected behavior
Passing arguments as named arguments should work universally because robot framework and python generally allow it
Desktop (please complete the following information):
Additional context
This change will affect a lot of keywords and should be tested thoroughly
Global search in the repo with regex @decorators.timeout_decorator\n yields 69 in results in 12 files
Kw GoTo has further specialized arg handling which should be addressed as a separate issue even though it is done in the same method which causes this issue QWeb.internal.decorators._equal_sign_handler
Also kw OpenBrowser does not allow using arguments url or browser_alias as named arguments
As with GoTo this should be address as a separate issue, this one does not originate from _equal_sign_handlerOpenBrowser https://duckduckgo.com browser_alias=chromeOpenBrowser url=https://duckduckgo.com browser_alias=chromeKeyword 'QWeb.Open Browser' got positional argument after named arguments.
Describe the bug Keywords which use internally the decorator
QWeb.internal.decorators.timeout_decorator
raise exceptionQWebElementNotFoundError("Use \\= instead of = in xpaths")
when giving the first argument as a named argumentFor example (https://duckduckgo.com/ search text input)
Click Element //input[@id\="search_form_input_homepage"]
works when=
characters of the xpath are escapedClick Element xpath=//input[@id="search_form_input_homepage"]
will not workClick Element xpath=//input[@id\="search_form_input_homepage"]
will not work even with escaped xpathBut
Is Element
which is not decorated bytimeout_decorator
accepts xpath as named argument. As unnamed arg the=
characters of xpath need to be escaped as expectedIs Element xpath=//input[@id="search_form_input_homepage"
worksIs Element //input[@id\="search_form_input_homepage"
worksIs Element //input[@id="search_form_input_homepage"
does not work (expected not to work)Bug originates from method
QWeb.internal.decorators._equal_sign_handler(args, kwargs, function_name)
To Reproduce Create a following rf test and run it
Expected behavior Passing arguments as named arguments should work universally because robot framework and python generally allow it
Desktop (please complete the following information):
Should not be dependent of OS/Browser/Version
Additional context This change will affect a lot of keywords and should be tested thoroughly Global search in the repo with regex
@decorators.timeout_decorator\n
yields 69 in results in 12 filesKw
GoTo
has further specialized arg handling which should be addressed as a separate issue even though it is done in the same method which causes this issueQWeb.internal.decorators._equal_sign_handler
Also kw
OpenBrowser
does not allow using argumentsurl
orbrowser_alias
as named arguments As withGoTo
this should be address as a separate issue, this one does not originate from_equal_sign_handler
OpenBrowser https://duckduckgo.com browser_alias=chrome
OpenBrowser url=https://duckduckgo.com browser_alias=chrome
Keyword 'QWeb.Open Browser' got positional argument after named arguments.