11 Complex Elements - biswajitsundara/Protractor GitHub Wiki

Auto Complete

When we enter text, then we need to select from the suggested drop down and this needs to be done using Action class.

describe('Protractor Practice Project', function () {
    it('Auto Complete', function () {
        browser.get('https://material.angular.io/components/autocomplete/examples');
        element(by.id('mat-input-1')).sendKeys('Shel');
        browser.actions().mouseMove(element(by.css("#mat-option-4 > span"))).click().perform().then(()=>{
            browser.sleep(4000);
        })
    });
});

Similarly we can have keyup, keydown, double click, right click, drag and drop etc.

⚠️ **GitHub.com Fallback** ⚠️