Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium IDE-Automating Select2 Search Box

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')
like image 665
user2296534 Avatar asked Apr 18 '13 18:04

user2296534


1 Answers

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

like image 148
Klendathu Avatar answered Nov 15 '22 14:11

Klendathu