kevin42036

Rerun function if not full completed

4 posts in this topic

#1 ·  Posted (edited)

Hi All,

I am very new to AutoIt and scripting in general so any tips or pointers would be extremely helpful. I am currently trying to do some manipulations to a web page through the use of MouseClick, WinWait, and Send commands. However, sometimes my computer lags and the steps wont be completed as expected. I want to write a check to verify that each step has been completed, and if not, the function will rerun. 

My thoughts are to have a checkpoint at each WinWait that basically lets me know if each webpage is reached properly and if so, a count is increased. If at the end of the the function, the count does not match the amount of WinWait scenarios, then it will exit the window and rerun. Any pointers on how to build this? I have written an example script outlaying how I think this should work logically. Any other inputs will be very helpful.

#include <IE.au3>

function1()

Func function1()
     Local $i=0
     While $i <=3
          _IENavigate (webpage 1)
          $i + 1
          Mouseclick (location)
          Send (info)
          Mouseclick (location)
          Winwait (webpage 2)
          $i+1
          Mouseclick (location)
         Send (info)
         Mouseclick (location)
         Winwait (webpage 3)
         $i+1
     WEnd
EndFunc

Edited by kevin42036

Share this post


Link to post
Share on other sites



As MouseClick and Send are not very reliable (depend on screen resolution, window position and user interaction might interfere with your script), I suggest that you fully automate the web page using _IE* functions.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

@water

Ah very great suggestion, thanks! I've been looking into using IE functions but cant seem to find any good guides or videos on it. I've been trying to use IE Builder but can't seem to get it to work. Would you suggest building it without using IE Builder? or does it significantly help by using IE builder?

Thanks!
Kevin

Share this post


Link to post
Share on other sites

Never tried IE builder. But using IE by having a look at the examples and ask questions here works as well ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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