简体   繁体   English

无法使用Protractor单击我的angularjs应用程序的Microsoft帐户的登录按钮

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

Following code for microsoft account login not working: 以下代码用于Microsoft Office帐户登录不起作用:

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. 我使用的是Chrome 64位浏览器。

Instead of using the global browser.driver... selector method, try using this concatenated syntax. 而不是使用全局browser.driver...选择器方法,请尝试使用此连接语法。

$('#cred_sign_in_button).click();

the $(..) is short hand for element(by.css(.. more examples -> http://luxiyalu.com/protractor-locators-selectors/ $(..)element(by.css(..更多例子 - > 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? 量角器有多种不同的方法可以选择属性。你是否介意发布你想要选择的按钮的HTML元素?

Use directly protractor methods if it is Angular like element(by.model('ios')); 如果它是Angular like element(by.model('ios')),则直接使用量角器方法; element(by.id('android')); 元件(by.id( '机器人')); etc., and use implicit wait until element is preset https://angular.github.io/protractor/#/api?view=ExpectedConditions . 等,并使用隐式等待,直到元素被预设为https://angular.github.io/protractor/#/api?view=ExpectedConditions Can you post the error and html so that we will have big picture. 你可以发布错误和HTML,以便我们将有大局。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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