Jump to content

Specialized script generator


Recommended Posts

Hi!

First, I'm totaly new to AutoIt. I ran in to it while searching for ways to automate software testing in a specific VB6 to .NET upgrading project that I'm working on.

I believe that AutoIt can be just the thing we need, but for efficiency I need to create a program to generate the AutoIt scripts we need.

I'm using the AutoItX COM and VB.NET to write the program. The functionality I would like is something like this:

A form with a button and a textbox. User clicks button to get open file dialog, selects a program which is then executed.

When the user clicks on or types something into a control in the executed program, corresponding AutoIt script is added to the textbox.

User interaction with other programs should not generate any script.

When the executed program is closed, the user is prompted to save the script.

When the script is then run, it shall execute the same program and perform the same interaction as the user did.

Maybe there are such programs out there? If so, I can't seem to find them!

What I need to complete my own try is some of the functionality of AutoIt Window Info, like getting the control under the mouse etc.

Any input, ideas or directions to information, is appreciated!

/ Mikael

Link to comment
Share on other sites

I should add that I've tried AutoHotKey and its AutoScriptWriter, which in principle is a form with a record/stop button for generating scripts.

I found that to be too insecure for testing purposes!

However, I believe that AutoIt with its control functionality (ControlSend etc) could do the trick!

/ Mikael

Link to comment
Share on other sites

lindsten....the program that you need is already been implemented...you can get it by downloading the script editor ("Scite")...after the installation goto the following path "C:\Program Files\AutoIt3\SciTE\ScriptWriter\AU3Record.exe"...Au3Record is what you are looking for....Good luck...

Link to comment
Share on other sites

Great!

Will this MacroGenerator make use of the ControlSend mechanism, or will the script end up looking like the AutoHotKey generated scripts with

"move mouse here, click, enter this text, wait some time, move mouse here, click"?

Sorry for asking and not finding out by myself! I don't have the possibility to try it until I'm back at work on Monday.

/ Mikael

Link to comment
Share on other sites

Great!

Will this MacroGenerator make use of the ControlSend mechanism, or will the script end up looking like the AutoHotKey generated scripts with

"move mouse here, click, enter this text, wait some time, move mouse here, click"?

Sorry for asking and not finding out by myself! I don't have the possibility to try it until I'm back at work on Monday.

/ Mikael

As far as I know it generates only "simple" syntax Send,MouseMove,MouseClick,...

Link to comment
Share on other sites

You will need to change the commands after it runs to make things more stable. For example, you can change "send" to "controlsend", so that the information you want sent to the control will be more stable. It should be pretty quick to make your change.

I see you want it to be more secure than AutoHotKey's tool. Here is the rub: Depending on the application, it may have a Microsoft type of control, or it may not. Say for example your user is attempting to interact with a program that has embedded flash. That will cause both AutoIt's tool and AutoHotKey's tool not to work, for the controls the user is attempting to script is Flash based, not Microsoft.

Another thing to think about is if the application is web based. If so, then you run into a different set of problems. Yes, you can script a web based app with AutoIt, but it is somewhat more involved, and in many cases you may end up looking at the source code of the page to get what you need as far as controls. There have been many improvements in this area (many Kudos to Dale and Big Daddy) but it isn't as easy as running a macro recorder.

What I may recommend (IMHO), is look at what the users are doing, and develop scripts that save them time. You will find the support will be easier, and less frustrating to the user. Having your users make scripts will drive you nuts as far as support otherwise.

Link to comment
Share on other sites

Thanks for the replies!

Volly, as I mentioned in my first post, the program that I'm considering to build shall be used in a specific project only.

It's a quite large migrating project, and the applications involved are either build in VB6 or VB.NET and they only use standard controls (mostly buttons, textfields and tabs). At least I hope they only use standard controls, there's maybe a few exceptions.

I've seen that control class names differ between VB6 and .NET programs, but it should be possible to have some kind of mapping between names of standard controls I believe.

/ Mikael

Link to comment
Share on other sites

Now I'm back at work and I have just tried this AutoItMacroGenerator and also the AU3Record program.

AU3Record produced the same kind of script that I got with AutoHotKey, i.e. mouse movement and klicks. This is to unsecure for my purpose.

MacroGenerator on the other hand used ControlClick instead of recording mouse movement. This is what I want!

However, the MarcoGenerator did not generate any script for my keyboard input :) and is thus useless to me. Is this a bug in my version?

I would need a combination of these two, like AU3Record but with the use of ControlClick like MacroGenerator.

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