Hi all,
I’m working with a csv and filling some fields in a browser.
I have a script like this
the ToDo is the result of a csvReadArray.
var i = 1; return ${ToDo[1][3]};
Which works just fine, but I’d like to use the var i inside the ${ToDo[ i ][3]}
And I can’t find the way for this to work.
PD. This is a simplified code, that i is actually inside a while and more other stuff is happening. But I encountered that this simple script won’t run and says: " [error]
Error in executeScript code: Unexpected token ‘{’ "
YES, it is insnide executeScript, but ToDo array is a Macro variable that I get from a CsvReadArray
What I want to do is to acces to that index of the array from a JS variable, and as I just said earlier the i vaiable is inside a loop, is not as simple.
because i need to verify data in other fields, if it’s a match then I fill it. To do this I’m using loops, I can do it with kantu while, but it’s too slow, that’s why I wanted to do the loop part in javascript.
If you explain better what you need to do you can make a better macro than the one you have made.
Explain what you need to do and indicate the urls of the pages so that you can understand and recommend a better code for your macro. I fill out so many forms without any problem so it’s really weird that you have all these problems for such a simple thing. Your macro needs to be optimized.
I confirmed that there is a problem using “outside” (Selenium IDE defined) arrays inside execute_script with a JS variable. But I found a solution/workaround: Copy (clone) the “outside array” (here: array1) to a JS array (here: brr):
I apologize for my intervention but I did not understand the problem of the user and therefore I asked for more details to find a solution to its automation.