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?

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


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?
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."

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.