How to Login by filling the form in CasperJs

前端 未结 4 831
闹比i
闹比i 2021-01-07 23:36

Following is the hlml of the login form that I have

4条回答
  •  执笔经年
    2021-01-07 23:44

    casper.waitForSelector("form input[name='name']", function() {
        this.fillSelectors('form#user-login', {
            'input[name = name ]' : 'abc@gmail.com',
            'input[name = pass ]' : 'pwd'
        }, true);
    });
    

    Simply use this (see waitForSelector docs). Firstly, wait for the form to be loaded. Then fill the form using the selectors.

提交回复
热议问题