dchriest Posted January 30, 2020 Share Posted January 30, 2020 I had in the past a script that I could use to automate the arming and disarming of a SImplysafe system via their website. The other day they updated the website and I can not figure out how to get the site to recognize that I entered in a user name and password. Seems they have changed the website to where the script below can no longer insert the user name and password where the site sees it. The script does insert the two values but the website does seem to know this. In looking at the code it appears that you now must click into the field and enter the text. Then they have javascript that changes a input class tag, changing some variables to things like "not empty" and "ng email", etc. I can't seem to figure out how to get the site to see that I entered in a value in each field. Before you enter in user name / password - <input class="password ng-valid ng-dirty ng-valid-parse ng-touched ng-empty" type="password" name="password" placeholder="password" ng-model="login.password" ng-keyup="$event.keyCode === 13 ? login.login() : null" aria-invalid="false" style=""> After you enter in user name / password - <input class="password ng-valid ng-not-empty ng-dirty ng-valid-parse ng-touched" type="password" name="password" placeholder="password" ng-model="login.password" ng-keyup="$event.keyCode === 13 ? login.login() : null" aria-invalid="false" style=""> The class="password ng-valid ng-dirty ng-valid-parse ng-touched ng-empty" doesn't seem to update by setting the field thru the script. Website - https://webapp.simplisafe.com/#/login (for testing you can create a dummy account by just registering - you don't have to have an actual account) Below is the original script - #include <IE.au3> #Include <IE.au3> Call ("SignIn") Sleep(8000) Call ("SetToHome") Sleep(40000) Call ("Signout") Sleep (3000) Call ("Terminate") Func SignIn() Global $oIE = _IECreate("https://webapp.simplisafe.com/#/login") Global $username = _IEGetObjByName ($oIE, "email") Global $password = _IEGetObjByName ($oIE, "password") _IEFormElementSetValue ($username, "your user name") _IEFormElementSetValue ($password, "your password") clickobjbyclass($oIE, 'ss-standard-button') EndFunc Func clickobjbyclass(ByRef $oIE, $class) $tags = $oIE.document.GetElementsByTagName('button') For $tag In $tags $class = $tag.GetAttribute('class') If String($class) = $class Then Return _IEAction($tag, 'click') EndIf Next Return False EndFunc Func SetToHome() Local $home = _IEGetObjById ($oIE, "home-circle") _IEAction ($home, "click") EndFunc Func SignOut() _IENavigate ($oIE, "https://webapp.simplisafe.com/logout") EndFunc Func Terminate() _IEQuit($oIE) Exit EndFunc Any help is greatly appreciated. Link to comment Share on other sites More sharing options...
Developers Jos Posted January 30, 2020 Developers Share Posted January 30, 2020 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. Link to comment Share on other sites More sharing options...
dchriest Posted January 30, 2020 Author Share Posted January 30, 2020 (edited) . Edited February 16, 2020 by dchriest Link to comment Share on other sites More sharing options...
dchriest Posted January 30, 2020 Author Share Posted January 30, 2020 (edited) . Edited February 16, 2020 by dchriest Link to comment Share on other sites More sharing options...
dchriest Posted January 30, 2020 Author Share Posted January 30, 2020 Ok, sorry. This can be deleted for I have created it in the Technical Discussion section. Link to comment Share on other sites More sharing options...
Danp2 Posted January 30, 2020 Share Posted January 30, 2020 The site uses the jQuery / Angular libraries, so you'll likely need to trigger some additional events to get the site functioning again. You may want to do a forum search on the term "jQuerify" for info on accessing the jQuery object. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted January 30, 2020 Moderators Share Posted January 30, 2020 Please stop creating multiple posts "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! Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted January 30, 2020 Moderators Share Posted January 30, 2020 (edited) Moved to the appropriate forum. Moderation Team Edit: Come on! Three Posts in 30 minutes, in three different spots? Really? Edited January 30, 2020 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! Link to comment Share on other sites More sharing options...
ilikecl Posted February 7, 2020 Share Posted February 7, 2020 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. Link to comment Share on other sites More sharing options...
dchriest Posted February 13, 2020 Author Share Posted February 13, 2020 (edited) Thanks ilikecl and Danp2 for the suggestions. I will give that a try for I have been unable to figure this out. Edited February 16, 2020 by dchriest Link to comment Share on other sites More sharing options...
dchriest Posted February 13, 2020 Author Share Posted February 13, 2020 (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 February 14, 2020 by dchriest Link to comment Share on other sites More sharing options...
ilikecl Posted February 19, 2020 Share Posted February 19, 2020 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now