Jump to content

Communication btw tests


Guest aallison
 Share

Recommended Posts

Guest aallison

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.

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

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