I have a page that contains the HTML form with javascript setup like if you click on a button with someid, the form gets submitted. I verified this by firing this in browser console:
document.getElementById("arcotsubmit").click()
As soon as it gets fired, the url changes and form gets submitted.
Now i tried to replicate this with casper.js:
var casper = require('casper').create({});
casper.start('https://cib.icicibank.com/corp/BANKAWAY?Action.CorpUser.Init1.001=Y&AppSignonBankId=ICI&AppType=corporate', function() {
this.echo(this.getTitle());
});
casper.then(function(){
this.click("#arcotsubmit");
});
casper.then(function(){
console.log(this.getCurrentUrl())
});
casper.run();
It stays on the same URL and downloads the same page. I want to download the html that appears after the button gets clicked by casper. The URL is live and can be tested directly.
My point is if i can use this command in browser console
document.getElementById("arcotsubmit").click()
and make it redirect, why i am unable to do it with this.click("#arcotsubmit") in casperjs?