Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Background Process or Unattended Process
Message
From
26/09/2003 07:52:57
Rene Lovino
Bigfoot Global Solutions, Inc
Cebu, Philippines
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Background Process or Unattended Process
Miscellaneous
Thread ID:
00832613
Message ID:
00832613
Views:
64
Hi All,

Is anybody there have an idea on how to run background application process using Visual FoxPro?

What I want to do is to create an application that automatically input value on the screen or click some of the control on the form. This application is actually doing an automated QA on our application.

My current application is using the timer control to execute the line of code in my script.
Some part of the code my code execute successfully except if there is a messagebox appear on the screen. How I could force my application to continue even there is a messagebox appear on the screen? I have notice that the execution of my application pause until I click the button on the messagebox. Is there any technique on how to do it whether using API or any other low level command? How could I determine if there is messagebox display on my screen?
Can we determine the type button appears in the messagebox such as retry, cancel, OK, Yes and others?

To better understand what I have mean't I have include my sample code.
You can copy to the .PRG file and run it so that you can see the result.

Below are the sample code in my script (i.e Stored in testscript.txt):

_vfp.ActiveForm.TxtCustNo.SetFocus()
_vfp.ActiveForm.TxtCustNo.Value = "ABC"
keyboard "{enter}"
_vfp.ActiveForm.TxtAddress.Value = "ABC Company, Cebu City"
keyboard "{enter}"
messagebox("Finish Executing Test. Close Application?", 3 + 32)
keyboard "{alt+Y}"
wait window "Test Finish" timeout 0.5

Note the I have form called "frmCust.scx" with textbox called "TxtCustNo" and "TxtAddress".

The following code is my timer class code (i.e. stored in probeproc.prg):
This will read my my script (testscript.txt) and execute each line of code.

DEFINE CLASS MyTimer AS Timer
FileHandle = 0
procedure LaunchTest
lcPath = sys(5) + curdir()
This.FileHandle = fopen(lcPath + "TestScript.txt")
This.Interval = 400
endproc
*/ --------------------------------
PROCEDURE Timer
if !feof(This.FileHandle)
lcLine = fgets(This.FileHandle)
&lcLine
else
fclose(This.FileHandle)
This.Interval = 0
endif
This.Reset()
RETURN
ENDDEFINE

Below is the code on that execute my time class execute the code in my script(i.e. stored in proberun.prg):

public oTimer
set procedure to probeproc additive
oTimer = Createobject("MyTimer")
oTimer.LaunchTest()
do form frmCust.scx


Any idea would be appreciated.
Thank you in advance,

Rene
Next
Reply
Map
View

Click here to load this message in the networking platform