Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deep Testing Forms

Status
Not open for further replies.
Jul 7, 1999
101
US
Does any one Know of a way to use an external program to test a form. ie IF form1 contains MYDATE how do I run the external program containing&nbsp;&nbsp;01jan1990 thru 01dec1999 but not 01jul1995 thru 30nov1996&nbsp;&nbsp;against MYDATE..<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thanks .....
 
What is the other program you are trying to retrieve the date off of? You could have that program save the date on a file and then gain access to the date through the first program. Need more information.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;John Stephens
 
You could write a small VB app that used SendKeys to control the applictation you're trying to test. <p>Mike<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>Please don't send me email questions without posting them in Tek-Tips as well. Better yet -- Post the question in Tek-Tips and send me a note saying "Have a look at so-and-so in the thingy forum would you?"
 
Thanks Mike,&nbsp;&nbsp;You seem to have an intuitive Wisdom of what poorly worded questions are trying to wrest from your <br>stores of Knowledge. Having never used sendkeys on program1 to control program2.Form1.mydate (as in rapid do loop run thru) instead of manually entering YEARS of data.<br><br>Could You send some some details.&nbsp;&nbsp;&nbsp;Thanks&nbsp;&nbsp;again&nbsp;&nbsp;
 
Mike .. that rapid do loop run thru Must be in the external<br>prog1 (for extensive testing) not the prog2.form1.mydate for one at a time datum entry.&nbsp;&nbsp;thanks
 
Hi Tuscon<br><br>From the VB5 help file.<br><br>=======<br>This example uses the Shell function to run the Calculator application included with Microsoft Windows.It uses the SendKeys statement to send keystrokes to add some numbers, and then quit the Calculator. (To see the example, paste it into a procedure, then run the procedure. Because AppActivate changes the focus to the Calculator application, you can't single step through the code.)<br><br>Dim ReturnValue, I<br>ReturnValue = Shell(&quot;CALC.EXE&quot;, 1) ' Run Calculator.<br>AppActivate ReturnValue ' Activate the Calculator.<br>For I = 1 To 100 ' Set up counting loop.<br> SendKeys I & &quot;{+}&quot;, True ' Send keystrokes to Calculator<br>Next I ' to add each value of I.<br>SendKeys &quot;=&quot;, True ' Get grand total.<br>SendKeys &quot;%{F4}&quot;, True ' Send ALT+F4 to close Calculator.<br>============<br><br>Now this *does* work, but I'm not sure how useful it will be to you. Testing an app is (and I know that you know this) more than just sending it keystrokes. You need to be able to react to what the &quot;target application&quot; - that you're testing - does.<br><br>For the limited kind of test you mention in your post it might be all right..... I'm willing to bet, however, that the limitations of this approach will drive you batshit in short order.<br><br>Have a look at Microsft Test, there are other test apps available but MS Test is ok.<br><br>Oh - and thanks for the kind words&nbsp;&nbsp;&lt;smile&gt;<br> <p>Mike<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>Please don't send me email questions without posting them in Tek-Tips as well. Better yet -- Post the question in Tek-Tips and send me a note saying "Have a look at so-and-so in the thingy forum would you?"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top