Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9313109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:47:53+00:00 2026-06-19T01:47:53+00:00

in selenium ide, i have built a test case, in which a array variable

  • 0

in selenium ide, i have built a test case, in which a array variable stores the values. i have used while loop to print those array variables.

enter image description here

here i have used “getEval | myarray[0]” to print the first value which is ‘postgresql’. but the value is not listed. no error occurs.

[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; | | 

now again in the same test case i have changed the “getEval | myarray[0]” as “getEval | myarray[${index}] to list the array values by loop index.

enter image description here

now i am getting the following error:

[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 

all i need is echo to print “postgresql” and “mysql” is separate new lines.
i am very new to selenium plz help me to solve this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T01:47:54+00:00Added an answer on June 19, 2026 at 1:47 am

    this did the trick for me, hope it helps others too…

    enter image description here

    [info] Executing: |storeEval | new Array("postgresql","mysql"); | myarray
    [info] script is: new Array("postgresql","mysql");
    [info] Executing: |getEval | index=0;
    [info] script is: index=0;
    [info] Executing: |while | index < storedVars['myarray'].length;
    [info] Executing: |storeEval | index | temp
    [info] script is: index
    [info] Executing: |echo | javascript{storedVars['myarray'][storedVars['temp']]}
    [info] echo: postgresql
    [info] Executing: |getEval | index++; 
    [info] script is: index++;
    [info] Executing: |endWhile | | |
    [info] Executing: |while | index < storedVars['myarray'].length; | 
    [info] Executing: |storeEval | index | temp |
    [info] script is: index
    [info] Executing: |echo | javascript{storedVars['myarray'][storedVars['temp']]}
    [info] echo: mysql
    [info] Executing: |getEval | index++; | |
    [info] script is: index++;
    [info] Executing: |endWhile | | |
    [info] Executing: |while | index < storedVars['myarray'].length;
    

    Here is the above in Source HTML for cut and paste:

    <tr>
    <td>storeEval</td>
    <td>new Array(&quot;postgresql&quot;,&quot;mysql&quot;);</td>
    <td>myarray</td>
    </tr>
    <tr>
    <td>getEval</td>
    <td>index=0;</td>
    <td></td>
    </tr>
    <tr>
    <td>while</td>
    <td>index &lt; storedVars['myarray'].length</td>
    <td></td>
    </tr>
    <tr>
    <td>storeEval</td>
    <td>index</td>
    <td>temp</td>
    </tr>
    <tr>
    <td>echo</td>
    <td>javascript{storedVars['myarray'][storedVars['temp']]}</td>
    <td></td>
    </tr>
    <tr>
    <td>getEval</td>
    <td>index++;</td>
    <td></td>
    </tr>
    <tr>
    <td>endWhile</td>
    <td></td>
    <td></td>
    </tr>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used selenium IDE and created test cases. I have converted them to
I have a selenium webdriver test case exported to python using selenium IDE. Then
I have recorded a very simple test case Using the Selenium IDE integrated with
I have a Selenium IDE (version 1.7.2) test that I use to test the
I have a c# code.(which is exported from selenium IDE) using System; using System.Text;
I used the Selenium IDE in Firefox to record a test suite in selenese,
Once you have a test defined in Selenium IDE, is it possible to run
I am wanting to test a web application which uses FCKeditor in Selenium IDE
I am using Selenium RC and I have a test case creating posts and
I have a variable stateID with value 11 in test case CreateStateID. How do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.