function this.click dont work on casperjs

39 views Asked by At

there is my code

var casper = require('casper').create();
    verbose: true;
    logLevel: 'debug';
        pageSettings: {
            loadImages: true;
            loadPlugins: true
        };

var url ="https://moodle-ingenieurs.cesi.fr/login/index.php?authCAS=CAS"

casper.start(url,function(){
    console.log("PAGE CHARGEE");
    casper.screenshot
  
});
casper.then(function(){
    casper.sendKeys('input#login','email');
    this.click("a.submit");
    console.log("PAGE 1 OK");
    
});

casper.then(function(){
    casper.sendKeys('input#userNameInput','Email');
    casper.sendKeys('input#passwordInput','Password');
    this.click("span#submitButton.submit");
    console.log("PAGE 2 OK");
    
});

casper.then(function(){
    casper.capture('navigation.png');
    console.log("capture ok");
});

casper.run();
This code is made so that I have an automatic authentication on the site of my school. The last this.click does nothing but I want it to click the connect button. All others this.click works but the last one doesn't if anyone knows how to fix my problem please tell me thanks.

0

There are 0 answers