8

I am trying to automate the select2 search box in selenium IDE. I got it to open and also typed the search keyword I am searching for.However even though I have the code in place for showing results, it does not work. The problem is I guess the characters are getting typed too fast, so the results don't show up for the search box. I am sure I am going wrong somewhere, because I am new to Selenium IDE .So any help is appreciated

  mouseDown css=.select2-choice > div > b
  type css=input.select2-input.select2-focused Chris
  waitForVisible css=.select2-results
  mouseUp css=.select2-result-label:contains('Chris')

1 Answer 1

6

I've had to deal with this as well, the sites I test use select2 and select3. What I've found that works in both situations would be the following:

clickAt | css=.select2-choice > div > b | 
sendKeys | css=input.select2-input.select2-focused | Chris
click | css=.select2-result-label:contains('Chris')

With these types of dropdowns, and Angular, I found sendKeys works better than type or typeKeys.

Klendathu

Sign up to request clarification or add additional context in comments.

1 Comment

It worked for me when modified slightly - same first step; sendKeys | css=#select2-drop input.select2-input | Chris ; same last step but with clickAt rather than click

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.