Selenium IDE-自动选择2搜索框 [英] Selenium IDE-Automating Select2 Search Box
问题描述
我正在尝试在selenium IDE中自动化select2搜索框。
我打开它并输入我正在搜索的搜索关键字。但是即使我有代码显示结果,它也不起作用。问题是我猜字符输入速度太快,因此结果不会出现在搜索框中。我确定我在某个地方出错了,因为我是Selenium IDE的新手。所以感谢任何帮助
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')
推荐答案
我也必须处理这个问题,我测试的网站使用select2和select3。我发现两种情况都适用如下:
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')
使用这些类型的下拉列表,和Angular,我发现sendKeys比type或typeKeys更好。
With these types of dropdowns, and Angular, I found sendKeys works better than type or typeKeys.
Klendathu
Klendathu
这篇关于Selenium IDE-自动选择2搜索框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!