Hi All,
I've been using AutoIt to automate logging into a website and doing some setting updates for several years now.
The services as updated its login page a couple times over the years, but I've always managed to get it going.
However, this latest update has me stumped on how to use AutoIt for it.
I am not a developer, so I am at a loss on what to do here. I am able to fill in the form for email and password using _IEGetObjByName, but the log in button no longer has a name specified.
I've searched the forums and tried a couple of different solutions using _IEFormElementGetCollection and _IEFormSubmit that didn't seem to work.
I suspect I am doing something wrong.
Any help would be greatly appreciated! Thank you!
The DOM:
<div class="login ng-scope" ng-class="{'processing-login-request': login.processingLoginRequest}">
<div class="decoration-plant"></div>
<div class="decoration-keyfob"></div>
<div class="login-container">
<div class="login-heading" ng-init="login.setTextResources({"ButtonOk":"ok","ButtonTryAgain":"try again","MessageResetPasswordSuccess":"Check your email. We’ve sent you instructions for resetting your password.","MessageResetPasswordFailure":"We couldn't process your request. Please check your internet connection and try again in a few moments."})"><!-- ngIf: !login.wasLoginChallenged -->
<div class="heading-title ng-scope" ng-if="!login.wasLoginChallenged">
<span class="logo"></span></div>
<!-- end ngIf: !login.wasLoginChallenged --><!-- ngIf: ssLogoutDueToInactivity --></div>
<!-- ngIf: !login.showResetPassword && !login.wasLoginChallenged -->
<div class="login-box login ng-scope" ng-if="!login.showResetPassword && !login.wasLoginChallenged"><!-- ngIf: !ssLogoutDueToInactivity -->
<div class="login-title ng-scope" ng-if="!ssLogoutDueToInactivity">Log In</div>
<!-- end ngIf: !ssLogoutDueToInactivity -->
<div class="login-entry"><input name="email" class="email ng-pristine ng-untouched ng-valid ng-empty ng-valid-email" aria-invalid="false" type="email" placeholder="email" ng-keyup="$event.keyCode === 13 ? login.login() : null" ng-model="login.username"></div>
<div class="login-entry"><input name="password" class="password ng-pristine ng-untouched ng-valid ng-empty" aria-invalid="false" type="password" placeholder="password" ng-keyup="$event.keyCode === 13 ? login.login() : null" ng-model="login.password"></div>
<!-- ngIf: login.wasLoginError -->
<!-- ngIf: login.wasLoginErrorBruteForce -->
<div class="login-link forgot"><span tabindex="0" class="ss-inline-text-action" role="button" ng-click="login.showResetPassword = true">Forgot your password?</span></div>
<div class="login-entry" ng-class="{'processing-login-request': login.processingLoginRequest}"><button class="ss-standard-button" type="button" ng-click="login.login()">log in</button></div>
<div class="login-link register"><div tabindex="0" class="ss-inline-text-action new-user" role="button" ng-click="login.navigateToRegister()">New user? Register here.</div>
</div>
</div>
<!-- end ngIf: !login.showResetPassword && !login.wasLoginChallenged -->
<!-- ngIf: login.showResetPassword -->
<!-- ngIf: login.wasLoginChallenged -->
</div>
</div>
My AutoIt Script:
Func SignIn()
Global $oIE = _IECreate("XXXXXXX"); login page
Local $username = _IEGetObjByName ($oIE, "email");sets the variable to the input name on the page (F12, DOM)
Local $password = _IEGetObjByName ($oIE, "password");sets the variable to the input name on the page (F12, DOM)
Local $submit = _IEGetObjByName ($oIE, "log in");sets the variable to the input name on the page (F12, DOM)
_IEFormElementSetValue ($username, "XXXXXXX");Put your username here between the quotes. This will then send what you've set to the variable input name set above.
_IEFormElementSetValue ($password, "XXXXXXX");Put your password here between the quotes. This will then send what you've set to the variable input name set above.
_IEAction ($submit, "click"); clicks the input 'op' we set as $submit above
EndFunc