0
votes

Please help with the Protractor testing within Google API field. The scenario is, I was able to sendkeys my value or location I want to find,but unable to select the first occurrence because I cannot select or keydown my cursor.And is there a way to get the innerHTML in Protractor? Kindly help. Thank you

script: element(by.id('address_permanentAddress_personal_details')).sendKeys('LocationAddress'); browser.actions().click(element(by.css('.pac-container.pac-logo.hdpi .pac-item:first-child'))).perform()

browser.sleep(1000); element(by.id('address_permanentAddress_personal_details')).sendKeys(protractor.Key.TAB);

Google API Javascript

NOV 25 screenshot

timeout error myscript

1

1 Answers

0
votes

You don't need to use actions class to select the location dropdown value. Try the below option

element(by.id('address_permanentAddress_personal_details')).sendKeys('LocationAddress'); 
var dropEle = element(by.css('.pac-container.pac-logo.hdpi .pac-item:first-child'));
await browser.wait(ExpectedConditions.elementToBeClickable(dropEle),5000,'Wait for first drop value');
await dropEle.click();

Hope it helps you