selenium ide test case ... search box issue

Using selenium IDE to create test cases. Theres an area that contains a search box. You have to first click on the box to start typing ex. cash. As you type in c  a   s  it pulls up the matching description and click the exact match. (see attached pic for screenshot)

Selenium inserts the commands as:

Command - click                    Target: text_primaryPlan     Value:
Command - type                    Target: text_primaryPlan     Value: cash
Command - clickAndWait      Target: ID_2                         Value:

When I run this it returns the following error:
[error[ Element ID_2 not found

Does anyone know the correct commands that will allow the search box to work properly?

           selenium IDE Search Box
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


Please add the following command right before the problematic click:


I'm pretty sure the problem is that the element you are clicking on it "not there yet" when Selenium-IDE runs the test very quickly.

Another way to see if this is a timing issue is to single-step through the test case. If your test case works that way, but not when IDE runs it, you can be sure you have a timing problem.

It's never a good idea to assume an Ajax element is "there." waitFor* it first!

anshealthAuthor Commented:
I tried that and it still doesn't work. I'm assuming because of the way the data is input into the box? I tried to copy and paste the word cash and it did nothing, but when I copied and pasted the word cash and pressed the space bar it brought up the list of options to choose from. Is there any way to add the "space" after the word cash so the search box will start to search?

Okay, so now try using "typeKeys" instead of the "type" that isn't working. Same two arguments--just change the command.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
anshealthAuthor Commented:
Perfect the only thing is that I have to run it half way between fast and slow. Is there a fix for that?

Heres what I did:

COMMAND      TARGET                VALUE
click                 insert_target
typekeys         insert_target         cash
click                 wanted_target      ID_1

Three items, the first of which is an answer to your specific question:

1. setSpeed(milliseconds) will give you programmatic control comparable to that speed-slider. The default is 0, i.e., no pausing between commands. So, you'll probably need to experiment a bit.

2. Your second click statement above (third statement overall) shows two arguments (TARGET and VALUE) when the click command only takes one. So, I'm not sure what you're trying to do there.

3. Assuming that second click is supposed to click on one of the values shown in response to your entering the string "cash", then I'm back to my initial advice. You really need a "waitForElementPresent" before that second click so that you can be sure it is present after the "typekeys."

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.