Sign in to follow this  
Followers 0
Guest aallison

Communication btw tests

3 posts in this topic

I have a master script that executes other script exes. The master uses a config file and runs all exes in a particular directory. I would like to have the master and batch tests communicate in order to be able to compile a report, but I can't get global variables or environment variables to work.

E.g.,

;In master script...
EnvSet("TestStatus", "No Run")
RunWait($NextTestEXEPath);This script will set the status var to "Pass"
MsgBox(0,"TestStatus",EnvGet("TestStatus");This still shows "No Run"

The example above works the same if I try to use a 'global' variable in a commonly loaded file as well. I can't get the communication to work.

Any ideas? Help is greatly appreciated.

Share this post


Link to post
Share on other sites



You'll want to use the AutoItWinSetTitle and AutoItWinGetTitle functions. Each running AutoIt script has one of these hidden windows that you can detect, so set this for communication between running scripts. An example:

Main Script

;some code here
;...
;...

AutoItWinSetTitle("Main: Waiting");set waiting text
WinWait("Child1: ");wait for the child to give us a responce
$responce = WinGetTitle("Child1: ");get the full text of the child's window
AutoItWinSetTitle("Main: Child1 recieved");let the child know we have the data
AutoItWinSetTitle("AutoIt v3");reset the title so further children don't get confused
;do something with the responce below

Child Script

;some code here
;...
;...

;now that we've done what we need, set the message to return:
AutoItWinSetTitle("Child1: success");set our message for the main script
WinWait("Main: Child1 recieved");wait for the main script to recieve our message
Exit

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post


Link to post
Share on other sites

i'm going to print this because i'm new :ph34r:


------------------------------------------------------------------If it were up to me, all computer stuff would work

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
Sign in to follow this  
Followers 0