Selenium IDE-Automating Select2 Search Box
Asked Answered
A

1

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')
Abrahan answered 18/4, 2013 at 18:59 Comment(0)
C
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

Cutcliffe answered 16/7, 2013 at 15:27 Comment(1)
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 clickCoastline

© 2022 - 2024 — McMap. All rights reserved.