Here is my problem: I want to take text data from a test website (The price and its name). To do this I use Selenium IDE.
First, I take the text data using the “storeText” command, then I do an echo to see if my variable is populated and finally, I run a JS script to make an alert in my window.
However, I keep getting this message: Failed: TIME missing ) after argument list.
I know it comes from my variables, but I can’t find a way to manage them and the Selenium IDE documentation is not very complete on this subject.
All I have just below:
This is my JS script :
alert("Le prix de " + ${name}.split(/bureau|jeu/)[1].split(" ").filter(Boolean).slice(0, 3).join(" ") + " est : " + ${price});
There is the .side file :
{
"id": "07932a19-54e5-4bef-aaed-84f1e39fe1b5",
"comment": "",
"command": "storeText",
"target": "css=.x-productListItem:nth-child(3) [data-automation="product-price"] div div ",
"targets": [],
"value": "price"
}, {
"id": "4c84f025-021b-4478-8a12-b57e215df71b",
"comment": "",
"command": "storeText",
"target": "css=.x-productListItem:nth-child(3) [data-automation="productItemName"]",
"targets": [],
"value": "name"
}, {
"id": "f9b319ea-01c2-48c8-9e02-158ee20dad86",
"comment": "",
"command": "echo",
"target": "${name}",
"targets": [],
"value": ""
}, {
"id": "a3678c8f-8010-400d-af1c-659608466dbe",
"comment": "",
"command": "executeScript",
"target": "alert("Le prix de " + ${name}.split(/bureau|jeu/)[1].split(" ").filter(Boolean).slice(0, 3).join(" ") + " est : " + ${price});",
"targets": [],
"value": ""
}
And a screen shot of my IDE :
I have also seen the use of the “echo” command with target: javascript{alert(“Hello world!”)}, but it does not work as I want. This causes it to appear in the console.