【发布时间】:2020-04-14 03:14:19
【问题描述】:
我正在尝试为我的登录页面实现一个页面对象模型。
conf.js
exports.config={
seleniumAddress:'http://localhost:4444/wd/hub/',
specs: ['spec.js']
}
spec.js
describe('Test suite to check the login', function(){
it('Check the browswer', function(){
browser.waitForAngularEnabled(false)
browser.get('http://some-login-page.com');
element(by.id('ctrlLogin_UserName')).sendKeys("valid-login");
element(by.id('ctrlLogin_Password')).sendKeys("valid-password");
element(by.id('ctrlLogin_LoginButton')).click();
});
})
package.json
"name": "automation",
"version": "1.0.0",
"description": "My first automation project",
"main": "conf.js",
"dependencies": {
"jasmine": "^3.5.0",
"protractor": "^5.4.3"
},
那么,我可以知道如何在这个登录页面上实现页面对象模型吗?谢谢!
【问题讨论】:
标签: javascript selenium testing selenium-webdriver automation