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')
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With