Jump to content

Mouse Searching For Statusbargettext


Recommended Posts

The two functions below are used to ensure a web page has fully loaded. After logging in MOVESHOWALL() is called then I use a while loop to continually run CHECKALLLINK() until it returns 1.

I have numerous sites that I check and I ran into an issue lately. Some sites do not have the same exact position for the java script:__doPostBack('AllLink','') I am looking for. It may be a few pixels above or below where I expect it to be.

Is there a way to have the mouse move up and down until it finds the java link?

; ----------------------------------------------------------------------------
; FUNC MOVESHOWALL()
; ----------------------------------------------------------------------------

Func MOVESHOWALL()
   MouseMove($SUBJECT_ON[1], $SUBJECT_ON[2], 0)


EndFunc  ;==>MOVESHOWALL


; ----------------------------------------------------------------------------
; FUNC CHECKALLLINK()
; ----------------------------------------------------------------------------
Func CHECKALLLINK()
   If StatusbarGetText($TITLEX) == "javascript:__doPostBack('AllLink','')" Then
      
      Return( 1);==>ExitLoop
   EndIf
   Return( 0)
EndFunc  ;==>CHECKALLLINK
Link to comment
Share on other sites

This is what I came up with is there a better way?

Sleep(5000)
$SUBJECT_ON=stringsplit("290,270",",")
MOVESHOWALL()
MouseClick("left")
Func MOVESHOWALL()
   $POSITION=1;1=up 2=down
   While 1
      MouseMove($SUBJECT_ON[1], $SUBJECT_ON[2], 0)
      If StatusbarGetText("Viropharma 843-204 - Microsoft Internet Explorer provided by Medidata Solutions Inc") == "javascript:__doPostBack('AllLink','')" Then ExitLoop
      If $SUBJECT_ON[2] > 230 And $POSITION = 1 Then
         $SUBJECT_ON[2]=$SUBJECT_ON[2]-5
      Else
         $POSITION=2
      EndIf

      If $SUBJECT_ON[2] < 270 And $POSITION = 2 Then
         $SUBJECT_ON[2]=$SUBJECT_ON[2]+5
      Else
         $POSITION=1
      Endif
   Wend
 
EndFunc  ;==>MOVESHOWALL
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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