Click() function isn't working in protractor scripts

后端 未结 4 1692
离开以前
离开以前 2020-11-28 11:15

I\'m trying to automate my tests with Protractor and Appium for an AngularJS site with jasmine framework in iPad simulator, sendkeys() function is working for u

4条回答
  •  时光说笑
    2020-11-28 11:23

    Try executing those commands without using the promise chain. It can be a problem in the previous chain.

    "use strict";
    require("jasmine-expect");
    var wd = require("wd");
    describe('my app', function() {
    it('should make the login test',function() {
      browser.get("http://10.0.22.82:8080/jws/fetablet");
      expect(browser.getCurrentUrl()).toEqual(("http://10.0.22.82:8080/jws/fetablet/#/login"));
      element(by.model('credentials.username')).sendKeys('RET02');
      element(by.model('credentials.password')).sendKeys('RET02');
      element(by.css('.login-button')).click();
      browser.sleep(8000);   
      expect(browser.getCurrentUrl()).not.toEqual("http://10.0.22.82:8080/jws/fetablet/#/login");
    });
    

    PS: You can avoid using the 'then' function when you do not need to use the result of the method. It is controlled by the control flow

提交回复
热议问题