I\'m beginner in test, both in Unit Test and UI Test
I\'m trying to create a UI test for my login page using following code:
console.log(\"Teste de L
Pretty sure that in a page.evaluate
environment, you can't reference anything from the Phantom script.
In your case, you could actually have multiple evaluate calls:
console.log("Teste de Login");
var page = require('webpage').create();
page.open('http://localhost/login', function(status) {
console.log("Page loadeed");
if(status === "success") {
page.render('example1.png');
}
page.evaluate(function() {
// $("#numeroUsuario").val("99734167");
document.getElementById('numeroUsuario').value = "99734167";
});
page.render('exampl2.png');
page.evaluate(function() {
// $("#formLogin").submit();
});
page.render('example3.png');
phantom.exit();
});