Thank you! Your feedback has been delivered
Thank you! Your feedback has been sent

Not able to login on a website using casperjs

I am trying to login to this website http://www.myntra.com but am unable to do so. Its quite urgent as other processes are stuck due to same.

It would be great if one can come up with a solution script for the same for the mentioned bounty.

User Gravatar

user352

Posted Sep 16 2013 5:09 UTC

$50


  • Assigned To user486
  • Solved
  • casperjs
  • 3362 Views

1 Replies


try.

//create casper object
var casper = require('casper').create({
    loadImages:false,
    verbose: true,
    logLevel: 'debug'
});

//set browser user agent
casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X)');

//Open URL
casper.start('http://www.myntra.com/');


casper.then(function() {
    // Click on LOGIN / SIGN UP
    this.click('div.mk-f-right a.btn-login');
});

casper.then(function() {
    // Click Login 
    this.click('span.signup-content span.blue');
});

casper.then(function() {

    //fill form
    this.fill('form.login-content', {
        'email' : 'hemerson_varela@yahoo.com',
        'password' : 'copernico'
    }, true);              

});

//open home page
casper.thenOpen('http://www.myntra.com/home.php/', function() {

    this.capture('screen.png');

});

casper.run(function() {

    //finish execution script 
    this.exit();
});
User Gravatar

user486

Posted Sep 17 2013 7:22 UTC

Solution

This didn't solve your task? Get your own custom solution.

Add a reply

By posting a reply on CodersClan you agree to our Terms & Conditions