Jump to content

Automatically log into Live.com


Jemboy
 Share

Recommended Posts

Hi,

I am trying to log into live.com using AutoIt.
There are several examples, but none of them work with the current webpage.

This is my code (because the username and password are not valid ;-) , I comment the "button click" out.):

#include <IE.au3>

Local $oIE = _IECreate("live.com")
_IELoadWait ($oIE)
_IELinkClickByText($oIE, "Sign in")


$o_form = _IEFormGetObjByName ($oIE, "f1")
$o_login = _IEFormElementGetObjByName ($o_form, "loginfmt")
$o_password = _IEFormElementGetObjByName ($o_form, "passwd")
$o_signin = _IEFormElementGetObjByName ($o_form, "idSIButton9")


$username = "test@hotmail.com"
$password = "testpassword"


_IEAction ($o_login, "focus")
_IEFormElementSetValue ($o_login, $username)
_IEFormElementSetValue ($o_password, $password)


;_IEAction ($o_signin, "click")

When I run the code I get the following:

GarbeledInput.jpg

The value being set is garbeled with "PlaceholderText".
Because of this, the username and password are invalid.

Here screenhot of the placeholders text:

FieldswithPlaceholderTextOK.JPG

When you start typing in one of the fields, the placeholder text is automatically deleted.
When you set a value it stays.

I found a workaround, to set focus on the element and send the username as an keyboard input to the field,
but I would like a clean solution based on variables.

So, does anyone now how to do this?

 

 

 

 

Edited by Jemboy
typing error
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...