Protractor how to test select2
问题 I have a select2 drop-down where you need to first enter 2 characters and then select your item. I am unable to test this with Protractor. var select2 = element(by.css('div#s2id_person')); select2.click(); select2.sendKeys('ip'); select2.sendKeys(protractor.Key.ENTER); The following gets an error about being unable to focus the element when you try to sendKeys. 回答1: The following snippet successfully activates and selects the first option in a select2 widget, it allows for loading options