need sikuli to loop, can't figure out how
Hi!
just tried to script a solution to a problem I have here with an unstable internet connection. The WLAN is w/o password, I need to autorise myself via a browser page. I'd like to:
(1) -let sikuli check every 5 minutes or so whether I'm online
(2) -if yes, nothing should be done except wait for another 5 minutes
(3) -if not, enter my log in data and then GOTO line 1
As far as I can tell, that is not really possible, but I don't have any python skills =(
Here is my solution, that is extremly unelegant because I have to enter my password in the script in plain text for I cannot use <<pw = input("
openApp ("Safari")
wait(5)
if exists ( ): # the image searched for is the login screen that is shown when the internet connection has dropped
click ( )
type (">>MYUSERNAME>>")
click ( )
type ("<<MYPASSWORD>>")
click ( )
wait(5)
closeApp ("Safari")
click( ) #opens spotlight, the mac finding routine
type ("KCL") #name of the executable script (this one)
type ("\n")
else: #if the image is not found, my computer has an internet connection
closeApp ("Safari")
click( ) #opens spotlight, the mac finding routine
type ("KCL") #name of the executable script (this one)
type ("\n")
I have to have sikuli keep looking even if it found the login screen (the <<if exists>> command found what it was looking for) and the sikuli script logged me in because after a successful login, the connection might drop soon after
EDIT: I am away when this script is running, so it doesn't bother me to be unable to work with the computer while the script is running. And I know the times in <<wait()>> are wrong, I put them this way for testing.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- sikulihelp
- Solved:
- Last query:
- Last reply: