3
在硒IDE中,我已經構建了一個測試用例,其中一個數組變量存儲值。我用while循環來打印這些數組變量。selenium IDE循環通過數組變量
在這裏,我曾用 「getEval | myArray的[0]」,打印的第一個值是'PostgreSQL的。但該值未列出。沒有錯誤發生。
[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; | |
現在再次在相同的測試情況下,我已經改變了 「getEval | myArray的[0]」 爲「getEval | myArray的[$ {索引}]通過循環索引列出數組值
。
現在我得到以下錯誤:
[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
所有我需要的是回聲打印「的PostgreSQL」和「mysql的」是獨立的新線 我是硒新的很新,可以幫助我解決這個問題。