How can we store document.readyState in a variable in UI Vision

Hi,

I’m trying to store document.readyStatus in a variable in kantu , but it returns undefined…

{
“Command”: “executeScript_Sandbox”,
“Target”: “var x = document.readyState; console.log(x);”,
“Value”: “x”
},

x returns undefined

@admin/@ulrich could you please help on this ? Thanks a lot

Two issues:

  1. You miss the return: executeScript | var x = document.readyState; console.log(x); return x; | x

  2. You need to use : “executeScript” instead of “executeScript_Sandbox”!!! Reason: The “_sandbox” version of executeScript has no access to the web page document. It is intended “only” for calculations etc that need no data from a website.

1 Like

Thanks , this worked well