Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Form elements set correctly but not submitting

$
0
0
Hello,

First off, hello (again?)! I've known about AutoIt for some time now but I've finally found a really good reason to get involved with it. :)

I'm currently working on a script that automatically launches a page, enters the credentials, and clicks the sign in button. I've gotten the script to work with focusing the fields and using Send() but I found that it didn't work 100% of the time and since I'm generating this for users in order to alleviate issues I'd really like to avoid that. I have gotten it to set the variables correctly and it lists them correctly in my MsgBox but no matter what I do the click seems to fail. I'm not sure if it's the way the watermark is working or some javascript behind the scenes. Any help would be much appreciated. :)

#include <IE.au3>
_IEErrorHandlerRegister()

$oIE = _IECreate("https://www.employflorida.com/vosnet/Default.aspx", 1, 1, 1, 1)
_IELoadWait($oIE)
$oForm = _IEFormGetObjByName($oIE, "aspnetForm")
$u_oObject = _IEFormElementGetObjByName($oForm, "ctl00$txtUsername")
_IEFormElementSetValue($u_oObject, "username")
$p_oObject = _IEFormElementGetObjByName($oForm, "ctl00$txtPassword")
_IEFormElementSetValue($p_oObject, "password")

MsgBox(0, "", "Username: " & _IEFormElementGetValue($u_oObject) & @CRLF & "Password: " & _IEFormElementGetValue($p_oObject))
$go_submit = _IEGetObjByID($oIE, "ctl00_cmdLogin")
_IEAction($go_submit, "click")


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>