Jump to content
Sign in to follow this  
Xieciunio

Controlling script from other application

Recommended Posts

Xieciunio

Hi,

This topic should probably be placed in dev section, but I do not have permission so I believe that You will be able to help me.

My problem: I am developing application and I wish to be able to control (by this application) when script is working, when it is paused (knowing on witch line it was paused would be nice) and when it is finished.

I was reading forum for some time, but couldn't find anything about it.

Will be glad for any help.

Share this post


Link to post
Share on other sites
Jos

Don't think it belongs in the Dev forum reading your description

Your description is (to say the least) vague, so wouldn't know what to suggest at this moment.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Xieciunio

Usp, You are right, sorry.

I am writing in C#. I wish to be able to control AutoIT script. When script will pause (let say that it will not be able to locate control) I wish to know about that. I do not know are there any outputs that could be send by script in case of this kind of situations and could be get by mine application. I was using AutoIt for some time and as far as I know, it just stop working when something is wrong. I need any way to check is script still working or not.

Point of my application is to try to make functional tests on application and I wish to use AutoIt as engine for automation.

Share this post


Link to post
Share on other sites
Jos

There are many ways to communicate with a script, which could be as simple as having a (hidden) GUI in your script where you read the status by reading the content of one or more controls on this GUI. You can always also use an INI file to read the status and there are many more options.


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Xieciunio

To be honest, I now feel like last noob. I was looking for some complicated solutions like checking state of process and You are telling me that this is simple task ^_^ And I am still not able to figure it out. I was thinking about adding some code to script that will, for example, write something into another file (like "IniWrite"), but this is not to elegant.

I was hoping to find something that will not require adding lots of lines to script, but I am going out of time so probably I will go for INI solution. If You have any other solution I will be more then grateful for suggestions.

One more question: is there any different between script that is waiting for some event because it should be waiting (for example "WinWaitActive") and script that is paused because there is error in script (control not found or something like this)?

Thank You for helping me, I am a bit desperate because this is high priority project for me.

Share this post


Link to post
Share on other sites
eltorro
Xieciunio

Thank's eltorro. It is nice solution, but I am looking for solution, witch will not require that script (that I wish to control) will be sending any kind of "I am alive" signals. I wish to be able to do check status of script from outside.

Share this post


Link to post
Share on other sites
eltorro

Thank's eltorro. It is nice solution, but I am looking for solution, witch will not require that script (that I wish to control) will be sending any kind of "I am alive" signals. I wish to be able to do check status of script from outside.

You don't have to send a signal unless you receive a query for status.

Writing to an INI file could be considered an "I am alive" signal.

Share this post


Link to post
Share on other sites
Xieciunio

You are right, I didn't understand idea of this in first time. All that I need now is to be able to send (as reply for status checking) information about status of script. Correct me if I am wrong, but after reading some topics I think that there is no way to check last executed line without putting some variable counters into script (this is something I can live with). All this addons (sending reply and counting lines can be added by another script).

Last thing is how to check is script paused or not. Any ideas how to do this??

Share this post


Link to post
Share on other sites
eltorro

Last thing is how to check is script paused or not. Any ideas how to do this??

What is the nature of the script you want to query the status of?

I would declare and set a global variable ($gf_Paused perhaps...) in the script and set it to true when you go into your "paused" loop. In the WM_COPYDATA message handler, send back the value of this variable.

Share this post


Link to post
Share on other sites
Xieciunio

What is the nature of the script you want to query the status of?

It will be script for testing functionality of some software (so mainly some clicking in controls, filling forms and reading text). I wish to make regression test with this, so I am expecting that during execution of script, there might be some error messages shown, some controls might not be found or window might not be shown. I need to be able to catch this kind of situation automatically, report them and go to another task.

I have just find this:

http://www.autoitscript.com/forum/index.php?showtopic=79950

I am not sure right now will this recognize situations that I am expecting as errors. Need to make some tests.

Previous idea was to check status of script, but if I could just send any error msg when script is not able to continue, than I would be more than happy :)

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  

×