Skip to main content
Kofax

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

308281

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"

 

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

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
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: make sure to replace "let<space>" 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). 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