Jump to content
Sign in to follow this  

Script runner - GUI Testing Tool

Recommended Posts


Hello there,

my problem is a bit "complex" so please take you time when reading it (sorry I searched several days for solutions)

found nothing similar so far, so:

I want to create or write a script that is filled with script snippets that are written into a C++ Gui.

This Gui then builds up a main-script:





Each tree item contains a script. The Action1 and Action2 share the scope within the MyGroup1

i can imagine a function:


the MyGroup1 function is stored somewhere in a separate au3 file and is included into a main script.

within this function there are:



the executeActions take the Action's script line by line and executes it in the scope of MyGroup1.

I want to use "execute" functions because i want to send the gui a message that an action is executed and set there an indicator.

Also the main script will get a clocking - and if the gui is in step mode, then line by line can be executed.

Also Variable values should be present.

My Problem is, that i dont really know how to get all declared Variables within a Local / Global scope of a script.

like in php i can do:




Well ... it's like a visual debugger I want to write - but its no debugger, but a GUI-Testing-Tool with a step by step mode.

Imagine you want to test a gui and want to create some testcases.

In the example MyGroup1 is a "testcase" with 2 Actions.

The Actions contain some scripts or are "Basic library functions"

to achieve this "stepping" I want to encapsulate each line or code-block I want to be executed as an "atom", into an execute function. This function has something like:




Well I could use the AutoItDebugger for debugging simple testcase actions.

but then I have a problem if the action1 is a function that is stored in a separate file. The debugger is not that "clever" to step into #include's - nor step into functions that are out of the main-script's file-scope.

so the basic target is:

- let the gui create snippet files or "inject" the test and action codes.

- run the main script ( feedback with sendmessage already working )

- main script has to tell the main application what's executing at the moment.

- main script should be able to be "stopped" for execution.

- The actions within a testcase "share" a scope, so they can communicate over variables.

- The testcases only can "communicate" over global defined variables.

- Global variables and global functions are defined within the testing tool's top of tree ( above the subtree of all testcases )

so stopping the tester-tool at a testcase / action is ok, but it should be possible to "break" within an action's script.

If I would know the defined variables within the code, i could "ask" the script by message to give me the value for the

local variables each. But I have to know the declared variables for this.

does someone have any ideas or input for me ?

or is it possible to get the autoit core written with a debug or Trapping mode or something ?

so that I would execute a script line by line... for each execution step a message or something has to be send to the running script.

Also it should be possible to get the local and global defined vars and macro-values out of this running script.

for the autoit-core this should be no real problem to realize, but within an autoitscript it's a bit "tricky".

I need this as fast as possible - please help me out !

thanks a lot,



Share this post

Link to post
Share on other sites

If I understand well:

You want to auto fill .au3 files with functions you call 'snippets'.

Well, .au3 files are plain text, so you could allways edit/filewrite one from within AutoIt, and run "AutoIt3.exe" with the .au3 file as a parameter.

To stop such script, just processkill autoit.exe

break within, I personally do that the monkey way, just If-fileexists('file')-Then a certain filename within c:\ on every important part in the code and give it an output in a file with a line nr or something.

Global vars, only possible within one script as far as I know, but I don't know much about that. :D

And why not communicate through a file or ini? Or else, http://www.autoitscript.com/forum/index.ph...s+communication or something

This bit above also works for telling another script what to do. Or the other way around, the 'client' script looks into a file for a known function name, just a thought.

My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

Share this post

Link to post
Share on other sites

Hey Triblade,

well thanks for your ideas.

yes, it's a possibility to call autoit to run an au3 file direcly, that is "generated" by another script or an instance or whatever knows the "snippets" - I just have to "assemble" them together into one big script - then within this script globals are possible.

I solved it currently that way:

- build up functions for each testcase

- wrap each call into before and after function calls for communication and breaking ( step mode )

- communication with CUI (anon pipe) or named pipes i'm currently testing.

the runner act's like a manager between gui and the scripting generation and run.

so the generation and the feedback to the gui can be made over autoit and not MFC (yugh)

the main problems are: the gui creates a project file (xml)

and i have to tell my script-runner to build up the complete testscript ( including it's communication ) with this project file.

( the snippets are included within this xml file - but i hate xml parsing lol )

It's a bit of work - but i have not that much time to complete it - so I will just code and code and code - LOL...

another problem is to get the testcase local variables into my gui when breaking on a testcase's script or testcases action-script.

but idea up to now is to take the snippet, replace all string contents with blanks, then regexp all words with beginning $,

unify them, and then the gui can ask the running script: "get variable value $xyz"

as result the script should return it's evaluated value.

you see the running testscript also needs some communication to the gui. but i can realize it by including my "base_com.au3" that contains the complete communication possibilities to the running gui.

well I'm at it...

maybe there is a more "simplier" way to assemble such snippets with "callbacks".

background is:

up to now the tool is written and uses a ruby interpreter (cli) and gui connects to it with anon-pipe (stdin/out)

the ruby cli is running within the executing environment, and there are build up classes and blocks that are evaluated

within the cli itself...

if this would be possible - a ruby like CLI with autoit, then autoIt scripts could add a little function into the env, fire it, and get all globals and locals etc within this running process.

I dont really like ruby and ruby is not predestinated to be a "gui" click and test tool ! autoIt is the candidate !!!

if autoit developers would implement a function like:

getLocalVars and getGlobalVars or getDefinedVars

( its like PHP does )

also do a "step" by "step" possibility by running a dynamic scripting, then this is what i need.

or a commandline debugger were I can build up a script and fire it, and call it step by step.

after each step get locals globals and state and line etc... this would be really cool =)

building up such a "cli" is a bit complex because one complete script has to be build up (because of the sharing environment)

within the autoit sources it should be a bit more easy to achieve this. but i have no sources and im no autoit author =)

thanks for your advice - I'm thinking about that "monkey way" - it may be a simple and working solution part.

regards, fishy.

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