Skip to main content

Unsupported features in the Java Script Engine (with regular webkit and classic browser)


Question / Problem: 

The first symptom that a robot might have encountered an error while running Java Script is incomplete page loading (the page doesn't load at all or just some elements are missing).

Java Script errors can be seen when using Browser Tracer to monitor the robot execution (in the Java Script tab). E.g.

"Illegal token"

"Unexpected identifier"

"Uncaught SyntaxError: Use of const in strict mode"

"WebSocket is not defined"

Answer / Solution: 

The Java Script engine in webkit robots supports ECMA 5 standards. Therefore, the new features in ECMA 6 (or later) are not supported.

Some of these features include:

  • Arrow function (=>)
  • Template literals (backquote ` )
  • let
  • const in strict mode
  • WebSockets - WebSocket is not supported in webkit and it's actually not compatible with webkit (because WebSocket keeps the connection open while webkit works in a completely opposite way; webkit gets all the data from a webserver then closes the connection and displays the data).

In some cases, it's possible to make code changes such that the robot can still execute the code.

For example:


Error /Issue Possible workaround
"Unexpected identifier" in Browser Tracer and code contains arrow function rewrite the java script code (use Replace text in JavaScript Execution tab in the robot or step properties)
"Unexpected identifier" in Browser Tracer and code contains "let"

replace "let " with "var "

Note: it's recommended to rather replace pattern "\s(let)\s" to avoid replacing words like "letter" or "delete" as well.

"Use of const in strict mode" in Browser Tracer Add a JavaScript change to replace 'use strict'; with nothing


In a lot of cases, editing the code would be very complicated (or impossible e.g. WebSocket component). In these cases, it's recommended to use the Chromium Embedded Framework (CEF) browser rather than webkit.


Applies to:  

Product Version Category
RPA any Design Studio


Author:  Delia Milchis

  • Was this article helpful?