-
Notifications
You must be signed in to change notification settings - Fork 19
single quotes sometimes converted to double quotes? #19
Description
From @worc on December 8, 2018 0:1
i don't even know on this one. i have an attribute selector with characters that break the underlying query (spaces and slashes in this case), so i wrapped the selector in double quotes and the full query in single quotes:
browser.click('input[name="enable_Selector With Spaces"][value=yes]')
and periodically the test would error out with this message:
An element could not be located on the page using the given search parameters.
Error: An element could not be located on the page using the given search parameters.
at click("input[name="enable_Selector With Spaces"][value=yes]") - at element("input[name="enable_Selector With Spaces"][value=yes]") - click.js:12:17
which at first glance seems like the single quotes around the full query are being converted to double quotes? i wasn't sure how to verify that, so i did the next best thing and changed the single quotes to backticks:
browser.click(`input[name="enable_Selector With Spaces"][value=yes]`)
at that point the error cleared up. but just to verify the issue, i switched the backticks back to single quotes, but the error no longer occurs. i'm thinking i probably just missed something juggling all those quotes and brackets, but figured i'd at least write down the weird thing i saw in case someone else encounters it.
"webdriverio": "^4.14.0",
"wdio-cucumber-framework": "^2.2.7",
"wdio-chromedriver-service": "^0.1.3",
Copied from original issue: webdriverio/webdriverio#3109