Selenium IDE-Automating Select2 Search Box

只愿长相守 提交于 2019-12-04 20:06:26

问题


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:


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



来源:https://stackoverflow.com/questions/16091053/selenium-ide-automating-select2-search-box

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!