Jump to content

Recommended Posts

Posted

Hi All,

This is probably a very easy problem/solution, but I have some code that I cannot get to work no matter what I try. All I want to do is pull up IE, enter some login credentials, and submit the form. Everything works fine, but I cannot get anything to actually do the submitting. Here is the code I have:

Run("C:\Program Files (x86)\Internet Explorer\iexplore.exe -new https://login.salesforce.com/","")

$sfWinHwnd = WinWaitActive("[CLASS:IEFrame]")

WinWaitActive("salesforce.com - Customer Secure Login Page - Windows Internet Explorer")

$sfIE = _IEAttach($sfWinHwnd,"HWND")

$sftxtName = _IEGetObjByName($sfIE,"username")

$sftxtPassword = _IEGetObjByName($sfIE,"pw")

$sfForm = _IEFormGetObjByName($sfIE,"login")

$sfLogin = _IEFormGetObjByName($sfForm,"Login")

_IEFormElementSetValue($sftxtName,"asdf")

_IEFormElementSetValue($sftxtPassword,"asdf")

_IEAction($sfLogin,"click")

And here is the code for the login button in the page's source:

<input class="loginButton" type="submit" id="Login" name="Login" value="Login" />

Does anyone know how I can get this to work?

Posted

GMK, I did try form submit, but that didn't work either.

jdelaney, I tried both of your suggestions and neither one seemed to work. The "if not" code did not kick off my messagebox so I took the "not" away and the box popped up.

Thanks for your help.

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
×
×
  • Create New...