Using ?runcount to Avoid Looping Problems
Novell Cool Solutions: Trench
Digg This -
Posted: 28 Apr 2004
I've struggled with scripts that use variables to prevent the looping problem caused by web apps that log out and then go back to the log in screen.
The only way I've ever had success is to ask every time whether you want to log in or not, and then either login or quit. This works, and is easy to set up, but is a little clunky as you have to click another yes/no box before you can get into the Web site.
Here's the type I've had luck with:
messagebox "Would you like to login to iManager?" -yesno ?run If ?run eq yes Type $Username Type $Password password click #1 Else gotourl http://support.novell.com Endscript EndIf
This one allows the variable to be maintained across many scripts.
If ?runcount(innerweb) Gt 0 Set ?runcount(innerweb) 0 EndScript Else Type $Username #1 Type $Password #2 Click #1 Set ?runcount(innerweb) 1 EndIf
This one works by me:
If ?runcount Gt 0 Set ?runcount 0 EndScript Else Type $Username #1 Type $Password #2 Click #1 Set ?runcount 1 EndIf