Jump to content

Feeling Stupid, need help!


Recommended Posts

Hey there,

I'm currently writing on a small function library for some automatic testing tools.

I noticed that there will be a lot of repeated commands in those testing tools.

For example send("{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{tab}")

You can see how crappy that style is.

I allready managed to shorten this special case to:

Func _tabrepeat ($repetitions)

For $counter = 0 To $repetitions Step +1

Send("{TAB}")

Next

EndFunc

A call for that shortens the example to:

_tabrepeat(11)

Now i don't want to writea _XXXrepeat($repetitions) for every command i might Need.

The idea would be about this _dotimes($command, $repetitions) to load the command i Need repeated into the function and reproduce it $repetition times.

So the example called would look about like this:

_dotimes(Send("{TAB}"), 11)

Now i have to load the command "Send("{TAB}")" or any other command from the variable in a way i can actually use it.

Is that possible somehow?

Link to comment
Share on other sites

or

Run("notepad.exe")
WinWaitActive("Untitled")
$ToDo = 'Send("{TAB}")'
_DoTimes($ToDo,11)

Func _DoTimes($dString,$dRepead)
For $i = 1 To $dRepead
Execute($dString)
Next
EndFunc
Edited by PlayHD
Link to comment
Share on other sites

Which automation tool are you talking about? There are some threads on the forum talking about software automation tools.

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

First of all: sorry for noobing around like this.

@Wayfarer

Thanks that was just what I ment!

@ AutoIt MVPs (MVP)

Well the tools dont even exist yet to be honest ^^'' in the end ist supposed to perform various checks on a certain programm that is under constant further decelopment. Regardless of that the in the end tool's suposed to run over night, check if everything is still working properly after changes in in the code, check for 0,00€ prices on articles in the integrated catalogue and basicly write an error protocoll to a .txt file

Link to comment
Share on other sites

Hi Necrotarch,

our names are PlayHD and Water, Wayfarer and AutoIt MVPs (MVP) are our titles ;)

As you are about to write a library I would stick with JohnOne's proposal.

IIRC I have seen such an automation library on the forum - but can't remember where. Will have a look.

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