automating login that requires keyboard input

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
userX
Posts: 1
Joined: 16 Dec 2017, 17:58

automating login that requires keyboard input

16 Dec 2017, 18:30

I have a script that logs in to websites, but I am having trouble with one site that requires keyboard input for authentication.

This is what I am doing that works on other sites:

Code: Select all

site := WBGet()

userID := {"fieldName": "ID of field / userID", "idText": "insert userID"}      ; userID as array w/ ID of ID element & Value to insert
pwd := {"fieldName": "ID of field / password", "pwdText": "insert password"}      ; pwd as array w/ ID of pwd element & Value to insert
buttonID :=  ID of field / button to login ; buttonID as text w/ ID of buttonID element & Value to insert

site.document.getElementByID(userID.fieldName).Value := userID.idText
site.document.getElementByID(pwd.fieldName).Value := pwd.pwdText
site.document.getElementByID(buttonID).Click()
(Should I be including the WBGet() code here?...)

This does not work on the following site:
https://www.myadt.com/index.jsp

-- even when I append the following to the code above:

Code: Select all

site.document.getElementByID(buttonID).fireEvent("onchange")
site.document.getElementByID(buttonID).fireEvent("onclick")
Myadt.com requires that actual keystrokes be entered in order for the fields' values to be submitted.

a) How do I work around this?
b) What can I do in the future to figure out how to work around this?

What I have done so far is inspect the DOM of the page in question. For example, I found that the site has a hidden

Code: Select all

div id="authenticate"
with a

Code: Select all

method = "POST"
that seems relevant, but I don't know how to use this to submit the login request.

Thanks!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: fiendhunter and 237 guests