Jump to content

Create a Procedure


Recommended Posts

Hi.

Great forum, I've managed to do almost everything I need by following various examples.

I'm a little stuck now :-( I'll explain.....

I'm writing a system test script. The script needs to be applied to several sets of test data, so I seperated the data from the script. The data is held in autoIT scripts, of the form

datafile

$MyVar1="data"

$MyVar2="data"

...and so on.

The test script uses these variables to execute. Works fine - For one set of test data!

eg.

#include<datafile1>

#include<testscript>

Now, I want to run the test script many times, against different datafiles

eg

#include<datafile1>

#include<testscript>

#include<datafile2>

#include<testscript>

#include<datafile3>

#include<testscript>

I KNOW this ain't gonna work! I don't think a function is the beast to use, and I can't

compile an .EXE as the data is going to change for each invocation.

I want a top-level script that has the effect...

read datafile1

run script

read datafile2

run script

Thanks.

The AutoIt help file should be interrogated.The Editor should be SciTe.The forums should have been searched.

Link to comment
Share on other sites

I'm close.... Just got to get the parameters passed correctly.

run(@AutoItExe & " Germany11_1RESIDENTIALNAME+ADDRESS.au3")

run(@AutoItExe & " PORTAL_TEST.au3")

The AutoIt help file should be interrogated.The Editor should be SciTe.The forums should have been searched.

Link to comment
Share on other sites

OK! sussed it.

Make the test script a function.

In the executing script, Include the test script, include the test data, call the function.

include more data, call the function again.

Simple. Dunno why I had so much bovver!

The AutoIt help file should be interrogated.The Editor should be SciTe.The forums should have been searched.

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