Current time: 12-17-2017, 04:18 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Windows Live ID Login?
04-19-2011, 11:59 AM
Post: #1
Script Windows Live ID Login?
My site allows users to login with a Windows Live ID, but I'm having some trouble automating login. I've tried it using the pagetest browser plug-in so I could get some debugging info and it fails on my attempt to submitForm / click (I tried both ways).

Am I doing something wrong here? The below script repros the issue on the live.com homepage with a test account I setup just for this post.

Code:
logData    0

// bring up the login screen
navigate    http://www.live.com

// log in
setValue    name=login    wpt-test@live.com
setValue    name=passwd    123456
//click id=idSIButton9
submitForm    submitName=f1

logData    1

Thanks,
Nick
Find all posts by this user
Quote this message in a reply
04-20-2011, 12:31 AM
Post: #2
RE: Script Windows Live ID Login?
Try this:

Code:
logData    0
navigate    https://login.live.com
logData    1
setValue    name=login    wpt-test@live.com
setValue    name=passwd    123456
setValue    name=remMe    0
clickandWait    id=idSIButton9

You'll need to move the "logData 1" to the end and add whatever navigation you actually want to measure after the login but the login itself worked for me: http://www.webpagetest.org/result/110419...4bd1d79f7/
Visit this user's website Find all posts by this user
Quote this message in a reply
04-20-2011, 03:03 AM
Post: #3
RE: Script Windows Live ID Login?
Ack, I feel so silly. It was because I had a space instead of a tab between the action and button ID! It might be a nice feature if the script parser accepted either (assuming there isn't a case where a space is used, I haven't read all of the scripting documents).

Thanks for the working version of the script!
Find all posts by this user
Quote this message in a reply
04-20-2011, 03:13 AM
Post: #4
RE: Script Windows Live ID Login?
It should be able to parse scripts with spaces if you are using the web UI (on the public instance). I'll check the logic and make sure it can also deal with multiple spaces in case that tripped it up.
Visit this user's website Find all posts by this user
Quote this message in a reply
04-20-2011, 03:44 AM
Post: #5
RE: Script Windows Live ID Login?
I was using the brower plugin to test that the scripts worked. Haven't actually tried it through the web UI yet (I'm using a private instance). I only had a single space, I reproduced the issue with your script by deleting the tab and adding a single space.
Find all posts by this user
Quote this message in a reply
04-20-2011, 04:54 AM
Post: #6
RE: Script Windows Live ID Login?
Hmm, so I'm trying to execute via the web UI and it seems the script has trouble on repeat view for my site. I don't think you'll be able to repro on Live.com since we're using an option in the API to turn off the user boxes and just display the same form again (it has the same IDs and everything, just has username pre-populated).
  1. Do scripts execute on the repeat view?
  2. Will the script clear a textbox that already has a value in it? On repeat view, my username is still in the login box.
Find all posts by this user
Quote this message in a reply
04-20-2011, 04:58 AM
Post: #7
RE: Script Windows Live ID Login?
Sorry, the browser plugin doesn't have the script scrubbing logic (and the private instance code doesn't have it yet either).

Scripts do execute for repeat view tests but cookies aren't cleared between runs so you usually need to log out as part of the script so that the repeat view script can execute all of the steps. I don't (yet) have a good way to allow the repeat view to run a different sequence of steps. The script I uploaded unchecks the "remember me" box so the user name shouldn't be populated in that case.

Thinking about it a bit, I might be able to add a couple of commands to let you identify blocks of a script to run only in first view or only in repeat view (with the default block logic to run in both).
Visit this user's website Find all posts by this user
Quote this message in a reply
04-20-2011, 05:22 AM
Post: #8
RE: Script Windows Live ID Login?
Hmm, watching closely, it seems that the line to disable Remember Me isn't working; the box remains checked. I ran through the scenario manually and when I uncheck it everything would go smoothly on a repeat run as the username isn't there.

I double-checked to make sure and the page I'm hitting does still have the name set to "remMe".

Any ideas? Obviously the default / first / repeat switch case could solve this, but it seems odd the checkbox is failing to update.
Find all posts by this user
Quote this message in a reply
04-20-2011, 05:52 AM
Post: #9
RE: Script Windows Live ID Login?
It's possible that the setValue command isn't actually working on checkboxes and I was imagining things when I thought it was working Sad I don't have any commands in the language to explicitly set the checked state so getting it to work properly is probably going to require a code change either way. I'll see if I can whip something up quickly tomorrow.
Visit this user's website Find all posts by this user
Quote this message in a reply
04-22-2011, 04:49 AM
Post: #10
RE: Script Windows Live ID Login?
Sorry, got swamped with some other issues but I also remembered that you can execute arbitrary javascript so this looks like it works:

Code:
logData    0
navigate    https://login.live.com
logData    1
setValue    name=login    wpt-test@live.com
setValue    name=passwd    123456
exec    document.forms[0].remMe.checked = false;
clickandWait    id=idSIButton9

If there are things that you might want to do in one pass but not another and you want it to just gracefully skip over them you can also add:

Code:
ignoreErrors    1

Before the part of the code you expect to fail (like clicking on a button that is sometimes there but not always).
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)