Escaping $ or Using $,$$,$x in executeScript


can I use ${someVar} to print variables that aren’t saved in the store?
can I use $(‘some css selector’), $$(‘some css selector’), $x(‘some xpath expression’) in execute script?

From my understanding $ is used to map vars from the store like ${SOME_VAR}

Incidentally, if I try to write a string like this `printing this thing here => ${blockScopedVar}`
where blockScopedVar exists within the scope of the executescript but is not an explicitly defined store var than that throws an exception.

My other issue and this might be unrelated, I want to use $x instead of document.evaluate to resolve xpaths, this was throwing an error, I’m guessing because $ is being used to resolve Vars but it could be that this is just not supported.

Can I escape $ to use it for other purposes or is $ striclty tied to resolving vars in the store

const someVar = " this is a var" 
const stringExp = `${someVar} is in a string` // "someVar" is not defined
const res = $x('//*[@id]') //  Unexpected token (1:22)

Interesting issue → I added this to our todo list :slight_smile: