Selenium IDE - Typing values stored in an array into a textbox? Selenium IDE - Typing values stored in an array into a textbox? selenium selenium

Selenium IDE - Typing values stored in an array into a textbox?


i'm using Selenium library through Robot Tests Framework. I'm not using any IDE, just using HTML to make test cases and defining new keywords.

When ever i want to access a list variable item, i just use the following sintaxe

@{list_variable_name}[0]

note that ${variable_name} is to access a single value variable or the reference to the list variable. If we want to access a list item we need to use @ instead of $.

If i understand your situation right, @{textBoxArray}[${i}] should work for you.

Try also${textBoxArray}[${i}] because it seems that your are simply misplaycing the last }.

More details athttp://robotframework.googlecode.com/svn/tags/robotframework-2.5.4/doc/userguide/RobotFrameworkUserGuide.html#list-variables


I think you need to replace your circled reference to ${textBoxArray[${i}] with

javascript{storedVars['textBoxArray['+storedVars['j']+']']}

Read this blog post for more information, especially the section about 'Setting and getting variables'.

Quoting from the article, consider

store | 10 | x

This obviously sets x=10. There are a couple of ways to reference it: ${x} or storedVars['x']. They're not the same.

In particular

You can't assign anything to ${x}.


You can insert one more command before your problematic line:

getEval | storedVars['text'] = storedVars['textBoxArray'][storedVars['i']];

And change problematic line to:

type | javascript{this.browserbot.getUserWindow().getTestingHooks('TextBoxValue_' + storedVars['i'])} | ${text} 

Also it will be probably helpful to declare your array in the beginning of the test:

storeEval | new Array() | textBoxArray