Skip to content
On this page

The script.js file

This file will contain both the NodeJS library download/call (if needed) as well as the JavaScript code that will interact with the json form variables that you have set on order to provide the target functionalities.

Examples of script.js

js
const hello = "hello world!";
await page.evaluate(function (hello) {
  return alert(hello);
}, hello);

This example we have page.evaluate(callback function()), page. is a object that point to the current page or html and here we want to run a javascript function that show user a alert message that sayed "hello world!".

Global variable in script.js

Is a variables in RTILA that we have for every role of custom command, we have tow global variable page.evaluate() and command

page.evaluate()

We use page.evaluate() mainly to run a javascript code in our current page.

command.fieldName

command is an object that we can use to access every field we define in config.json