selenese-runner-java
selenese-runner-java copied to clipboard
Is it support template literals?
Hey there, as I see when we have this command
{
"id": "87663521-6dd0-432f-9f85-84d9eebb7806",
"comment": "",
"command": "executeScript",
"target": "let bar = \"123\"; return `${bar} hello`",
"targets": [],
"value": "seller_url"
},
In selenium and in your runner the result is different
Selenese
[2020-11-13 20:04:22.297 +03:00] [INFO] <4> Command#4: executeScript("let bar = \"123\"; return `${bar} hello`", "seller_url")
[2020-11-13 20:04:22.328 +03:00] [INFO] - [null hello]
Selenium-IDE
It will be fair to say that I've been developing a similar tool as selenese for a while and bump into the same issue :( I didn't know about existent of this repo before.
Thanks for selenese
ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
I fixed this problem and released version 3.33.0. Please test it.
Hey @vmi I've review your changes it's seems to work :+1:
I would only mention in a doc comment for replaceVars
that it prioritize selenium vars after js vars if the names are the same.
Actually there's a major change in your code isn't it? In case if variable isn't present in environment there will be not emitted anything but for example in Selenium IDE as I remember it emits empty string.
In case if variable isn't present in environment there will be not emitted anything but for example in Selenium IDE as I remember it emits empty string.
Ultimately I was wrong I guess.
But it will be interesting to hear you according to it