javaScript failed


Please help

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


other question:
they are two way run jenkins , can i to get the detail log about each step when i parallel run with test suit .