I am working on an test automation and using protractor with jasmine framework. While handling an autocomplete select (selection drop-down i.e countries' name drop-down). I wanna send keys to this autocomplete select drop down in the way as browser.actions().mouseMove(addMember.getLocationInput().sendKeys('UAE')).perform();
but it creates a syntax error. When i remove sendKeys('UAE')
it removes syntax error but i have to send keys to it. Can any one help me to send keys to this autocomplete select. You can find the complete test case in the attached file. Thanks in advance
it('Should add Instructor successfully',()=>{
return new Promise((res)=>{
let email = Math.floor(Math.random()*10000)+1;
addMember.getAddMemberSubMenu().click().then(()=>{
setTimeout(()=>{
addMember.getFirstNameInput().sendKeys("John");
addMember.getLastNameInput().sendKeys("Doe");
addMember.getEmailInput().sendKeys(email+"@gmail.com")
addMember.getUserRolesInput().element(by.cssContainingText('option','Instructor')).click();
addMember.getCountryCodeInput().element(by.cssContainingText("option","UAE (+65)")).click();
addMember.getPhoneNumberInput().sendKeys('231321321321');
//Here is the syntax error
browser.actions().mouseMove(addMember.getLocation().sendKeys('UAE')).perform();
browser.actions().sendKeys(Key.ARROW_DOWN).perform();
browser.actions().sendKeys(Key.ENTER).perform();
addMember.getSaveButton().click();
return new Promise((resolve)=>{
setTimeout(()=>{
expect(browser.getCurrentUrl()).toContain('people').then(()=>{
resolve();
res();
})
},browser.params.Waiting_time.AVERAGE);
});
},browser.params.Waiting_time.HIGH);
});
});
});