Jump to content

Rerun function if not full completed


Recommended Posts

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
Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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...