You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello
thanks for this code it's helpful
i tried to run it and got a login to western-union and save headers on a output text file .but i have a problem to run it .
here my code
var x = require('casper').selectXPath;
casper.options.verbose = true;
casper.options.logLevel = 'debug';
casper.options.userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4';
casper.options.viewportSize = {width: 1366, height: 648};
casper.on('page.error', function(msg, trace) {
this.echo('Error: ' + msg, 'ERROR');
for(var i=0; i<trace.length; i++) {
var step = trace[i];
this.echo(' ' + step.file + ' (line ' + step.line + ')', 'ERROR');
}
});
casper.test.begin('Resurrectio test', function(test) {
casper.start('https://www.westernunion.com/fr/fr/home.html');
casper.waitForSelector(x("//a[normalize-space(text())='Se connecter']"),
function success() {
test.assertExists(x("//a[normalize-space(text())='Se connecter']"));
this.click(x("//a[normalize-space(text())='Se connecter']"));
},
function fail() {
test.assertExists(x("//a[normalize-space(text())='Se connecter']"));
});
casper.waitForSelector("form[name=registrnForm] input[name='txtEmailAddr']",
function success() {
test.assertExists("form[name=registrnForm] input[name='txtEmailAddr']");
this.click("form[name=registrnForm] input[name='txtEmailAddr']");
},
function fail() {
test.assertExists("form[name=registrnForm] input[name='txtEmailAddr']");
});
casper.waitForSelector("input[name='txtEmailAddr']",
function success() {
this.sendKeys("input[name='txtEmailAddr']", "[email protected]");
},
function fail() {
test.assertExists("input[name='txtEmailAddr']");
});
casper.waitForSelector("form[name=registrnForm] input[name='txtKey']",
function success() {
test.assertExists("form[name=registrnForm] input[name='txtKey']");
this.click("form[name=registrnForm] input[name='txtKey']");
},
function fail() {
test.assertExists("form[name=registrnForm] input[name='txtKey']");
});
casper.waitForSelector("input[name='txtKey']",
function success() {
this.sendKeys("input[name='txtKey']", "tatattctaoc");
},
function fail() {
test.assertExists("input[name='txtKey']");
});
casper.waitForSelector("form[name=registrnForm] button#btn-do-login",
function success() {
test.assertExists("form[name=registrnForm] button#btn-do-login");
this.click("form[name=registrnForm] button#btn-do-login");
},
function fail() {
test.assertExists("form[name=registrnForm] button#btn-do-login");
});
casper.then(function() {
casper.waitWhileSelector(x("//*[@id='notification-message']"));
});
//======== /* GET_SCREEN */ ==========
casper.then(function(){
console.log("Make a screenshot and save it as AfterLogin.png");
casper.waitWhileSelector(x("//*[@id='notification-message']"));
this.capture('AfterLogin.png');
});
//======== /* HEADERS */ ==========
casper.then(function dumpHeaders(){
console.log("getting headers");
this.currentResponse.headers.forEach(function(header){
console.log(header.name +': '+ header.value);
})
})
//======== /* submit form */ ==========
casper.run(function() {test.done();});
});
any help ?
The text was updated successfully, but these errors were encountered:
Good afternoon. I tried this code and it didn't work for me either. I tried to run it and got the western-union login and saved the headers in the output text file. I also wanted to try it on a similar site western union locations, but I have a problem launching it. I do not understand at what stage the project is.
hello
thanks for this code it's helpful
i tried to run it and got a login to western-union and save headers on a output text file .but i have a problem to run it .
here my code
any help ?
The text was updated successfully, but these errors were encountered: