简体   繁体   中英

Unable to click login button of Microsoft account of my angularjs application with Protractor

Following code for microsoft account login not working:

browser.driver.findElement(By.css("#cred_userid_inputtext")).sendKeys("suyash@xxxxx.onmicrosoft.com");
browser.driver.findElement(By.css("#cred_password_inputtext")).sendKeys("xxxx2");
browser.driver.findElement(By.id('cred_sign_in_button')).click();
browser.driver.findElement(By.id('cred_sign_in_button')).click(); browser.driver.sleep(5000);   

I am using Chrome 64 bit browser.

Instead of using the global browser.driver... selector method, try using this concatenated syntax.

$('#cred_sign_in_button).click();

the $(..) is short hand for element(by.css(.. more examples -> http://luxiyalu.com/protractor-locators-selectors/

Protractor has a number of different ways you can select an attribute.Would you mind posting the HTML element for the button you are trying to select?

Use directly protractor methods if it is Angular like element(by.model('ios')); element(by.id('android')); etc., and use implicit wait until element is preset https://angular.github.io/protractor/#/api?view=ExpectedConditions . Can you post the error and html so that we will have big picture.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM