loop ide selênio através de variáveis de matriz
em selenium ide, eu construí um caso de teste, no qual uma variável de array armazena os valores. Eu usei while loop para imprimir essas variáveis de matriz.
aqui eu usei "getEval | myarray [0]" para imprimir o primeiro valor que é 'postgresql'. mas o valor não está listado. nenhum erro ocorre.
[info] Executing: |getEval | myarray = new Array('postgresql','mysql'); | |
[info] script is: myarray = new Array('postgresql','mysql');
[info] Executing: |getEval | index=0; | |
[info] script is: index=0;
[info] Executing: |while | index < myarray.length; | |
[info] Executing: |getEval | myarray[0] | mynewvalue |
[info] script is: myarray[0]
[info] Executing: |echo | ${mynewvalue} | |
[info] echo: ${mynewvalue}
[info] Executing: |getEval | index++; | |
[info] script is: index++;
[info] Executing: |endWhile | | |
[info] Executing: |while | index < myarray.length; | |
[info] Executing: |getEval | myarray[0] | mynewvalue |
[info] script is: myarray[0]
[info] Executing: |echo | ${mynewvalue} | |
[info] echo: ${mynewvalue}
[info] Executing: |getEval | index++; | |
[info] script is: index++;
[info] Executing: |endWhile | | |
[info] Executing: |while | index < myarray.length; | |
agora novamente no mesmo caso de teste eu mudei o "getEval | myarray [0]" como "getEval | myarray [$ {index}] para listar os valores da matriz pelo índice de loop.
agora estou recebendo o seguinte erro:
[info] Executing: |getEval | myarray = new Array('postgresql','mysql'); | |
[info] script is: myarray = new Array('postgresql','mysql');
[info] Executing: |getEval | index=0; | |
[info] script is: index=0;
[info] Executing: |while | index < myarray.length; | |
[info] Executing: |getEval | myarray[${index}] | mynewvalue |
[info] script is: myarray[${index}]
[error] Threw an exception: missing ] in index expression
tudo que eu preciso é eco para imprimir "postgresql" e "mysql" é novas linhas separadas. Eu sou muito novo para selênio plz me ajudar a resolver isso.