Jump to content

Recommended Posts

  • Developers
Posted

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

  • Moderators
Posted (edited)

Moved to the appropriate forum.

Moderation Team

Edit: Come on! Three Posts in 30 minutes, in three different spots? Really?

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted

Not sure if you figured this out or not.

I ran into the same issue, but solved it by making IE the active window, then focusing on the form fields and using Send() to simulate sending in the email and password.

Hope that helps.

Posted (edited)

I was able to finally able to figure this out. 

#Include <IE.au3>

Call ("SignIn")
Sleep (10000);<= delay 10 seconds
Call ("SetToHome")
Sleep(30000);<= delay 30 seconds
Call ("Signout")
Sleep (10000);<= delay 10 seconds
Call ("Terminate")

Func SignIn()
   Global $oIE = _IECreate("https://webapp.simplisafe.com/#/login")
   Local $hIE

   While Not IsHWnd($hIE)
      $hIE = _IEPropertyGet($oIE, "hwnd")
   WEnd

   While Not WinActive($hIE)
      WinActivate($hIE)
   WEnd

   Sleep (3000);<= delay to allow IE to load SS site
   Send("{TAB 6}");<= tab to email ddress field
   Sleep (3000);<= delay to allow IE to load SS site
   Send("YOUR EMAIL ADDRESS");<= enter email address
   Send("{TAB}");<= tab to password field
   Sleep (3000);<= delay to allow IE to load SS site
   Send("YOUR PASSWORD");<= enter in password
   Sleep (3000);<= delay to allow IE to load SS site

   clickobjbyclass($oIE, 'ss-standard-button');<= find login button
EndFunc

Func clickobjbyclass(ByRef $oIE, $class)
    $tags = $oIE.document.GetElementsByTagName('button');<= get all button classes on page
    For $tag In $tags
        $class = $tag.GetAttribute('class')
        If String($class) = $class Then ;<= looking for ss-standard-button class of the login button
            Return _IEAction($tag, 'click');<= press login button
        EndIf
    Next
    Return False;<= error out in case the login button is not located
EndFunc

Func SetToHome()
    Local $home = _IEGetObjById ($oIE, "home-circle");<= locate the home-circle class
    _IEAction ($home, "click");<= press Home
 EndFunc

Func SignOut()
       _IENavigate ($oIE, "https://webapp.simplisafe.com/#/logout");<= logout of account
EndFunc

Func Terminate()
    _IEQuit($oIE);<= exit IE
    Exit
EndFunc

Edited by dchriest
Posted

Nice!

Unfortunately for me, I needed this to work on a headless server I had, so I ended up compiling a Python script into 2 separate apps that use the SS API for OFF and HOME functions.

  • dchriest changed the title to Automating

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...