Jump to content

Recommended Posts

Posted

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({&quot;ButtonOk&quot;:&quot;ok&quot;,&quot;ButtonTryAgain&quot;:&quot;try again&quot;,&quot;MessageResetPasswordSuccess&quot;:&quot;Check your email. We’ve sent you instructions for resetting your password.&quot;,&quot;MessageResetPasswordFailure&quot;:&quot;We couldn't process your request. Please check your internet connection and try again in a few moments.&quot;})"><!-- 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 &amp;&amp; !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

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...