I am writing an automation script to sign into draftkings.com. I am using sendKeys() to add my login credentials to the required fields. The first use of sendKeys() is for the username field which has the ID "Username". This will actually put my username into the field. The second use is for the password field with the ID "Password". However, this puts the desired text for this field into the username field. Am I missing something?
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('https://draftkings.com');
casper.then(function() {
this.clickLabel('Sign-in', 'a');
});
casper.then(function() {
this.sendKeys('#Username', 'xxxx');
this.sendKeys('#Password', 'xxxx');
this.click('a[data-signin-submit="1"]');
});
casper.then(function() {
this.capture('test67_failed.png');
});
casper.run();
UPDATE:
I was unable to figure out why sendKeys
was not working properly. I ended up just using this.evaluate()
to enter the values into the fields with document.querySelector()
.
NEW ISSUE:
I can see in the console output that 'a[data-signin-submit="1"]'
is being clicked and that the http request is being sent, but it is not actually logging me it. I am using phantomJS 2.0.0 so it is not an ssl issue though I tried that already. If my credentials were the capture would show that.
I have a simple react component to which I want to add a simple math function named doMath that uses property values. class MyClass extends Component { constructor( props ) { super( ......
I have a simple react component to which I want to add a simple math function named doMath that uses property values. class MyClass extends Component { constructor( props ) { super( ......
I'm creating a 12 days of Christmas javascript program and when I print out the statement it keeps repeating the statement. Can you give me any suggestions on how to fix this and get the program to ...
I'm creating a 12 days of Christmas javascript program and when I print out the statement it keeps repeating the statement. Can you give me any suggestions on how to fix this and get the program to ...
I would expect the following code to create an element which contains a div with the text "Hi" in it. The element appears in the inspector, but no text is visible on the screen. When I change the ...
I would expect the following code to create an element which contains a div with the text "Hi" in it. The element appears in the inspector, but no text is visible on the screen. When I change the ...
I have HTML like below <ul id="tabStripSecondaryElements" class="k-tabstrip-items k-reset" data-role="tabstrip" style="margin-left: 37px; margin-right: 40px;" role="tablist" aria-activedescendant="...
I have HTML like below <ul id="tabStripSecondaryElements" class="k-tabstrip-items k-reset" data-role="tabstrip" style="margin-left: 37px; margin-right: 40px;" role="tablist" aria-activedescendant="...