Last active
August 29, 2015 14:25
-
-
Save collegeimprovements/ef3589791e8e793c6104 to your computer and use it in GitHub Desktop.
gist to fill textboxes with casperjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var casper = require('casper').create({logLevel: "debug"}); | |
casper.start('https://alarmadmin.alarm.com/default.aspx', function() { | |
casper.echo(this.getTitle()); | |
if(this.exists('#txtUsername')) | |
{casper.echo('\n\n#txtUsername found***>>>');}else{casper.echo('\n\n#txtUsername NOT found***>>>');} | |
if(this.exists('#txtPassword')) | |
{casper.echo('\n\n#txtPassword found***>>>');}else{casper.echo('\n\n#txtPassword NOT found***>>>');} | |
this.sendKeys('input[name=txtPassword]', 'Cybage1'); | |
this.sendKeys('input[name=txtUsername]', 'cybagereg'); | |
casper.capture('pre.png'); | |
this.click('#butLogin'); | |
casper.capture('aha.png'); | |
casper.wait(8000,function(){ | |
casper.echo(this.getCurrentUrl());}); | |
}); | |
casper.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment