进程退出,错误代码为1

时间:2016-10-19 12:15:10

标签: protractor

为什么使用量角器

在以下情况下测试运行失败

conf.js

    exports.config = {
    framework: 'jasmine',
    seleniumAddress: 'http://localhost:4444/wd/hub',
    specs: ['example_spec.js']
    }

    example_spec.js

    describe('LoginGUI App Test', function() {
    it('LogInToGUI', function() {
    browser.get('http://10.2.5.6:2772/#/login');
    browser.waitForAngular();
    element(by.model('user.username').sendkeys('abc@gmail.com'));
    element(by.model('user.password').sendkeys('abc123'));
    });
    });

错误: 进程退出,错误代码为1  我已经使用了sendkeys和sendKeys方法来发送键的值,但是看到同样的错误....不确定为什么看到错误

2 个答案:

答案 0 :(得分:3)

元素声明后缺少一个括号,需要关闭它。

element(by.model('user.username')).sendKeys('123');

答案 1 :(得分:0)

你的代码中有拼写错误。 这应该工作

element(by.model('user.username')).sendKeys('abc@gmail.com');
element(by.model('user.password')).sendKeys('abc123');
相关问题