Hi, can you print the CSS path before executing the javascript to see if the path needs escaping. Also to be safe try wrap the string around triple quotes as @Russ_Thomas suggested below.
It’s unfortunate where you left your mouse pointer, so I’m assuming the class part is valid.
Try like this:
def clickUsingJS2(TestObject to) {
String path = to.get...(SelectorMethod.CSS)
String js = """
var path = '${path}';
document.querySelector(path).click();
"""
WebUI.executeJavaScript(js, null);
}
1 Like

