Overture Search the Web.
Type it and go!
 
 
 
 

4Test Tips - SYS_Execute Function

SYS_Execute function and .vbs files

The SYS_Execute function cannot directly run .vbs files on Windows 98 or Windows 2000. The message, "%1 is not a valid Win32 application", is associated with this problem. This is Segue bug #25796.
4Test Solution - As Segue describes in their 5.0.3 Release Notes, use the start command within the SYS_Execute call to run .vbs files.

    SYS_Execute("start yourprogram.vbs")

SYS_Execute function returns 256 times the proper return value on UNIX

The SYS_Execute function appears to multiply the returned value by 256 on QA Partner 4.0 on Solaris 2.5.
Solution - Write a function called UNIX_Execute that calls SYS_Execute.  In that function detect return values of 256 and above and divide by 256 to get the actual value.  Replace your other calls to SYS_Execute to call the new function for UNIX platforms.

SYS_Execute function intermittently returns 36096 and does nothing on UNIX

Occasionally, the SYS_Execute function returns the value 36096 (that's 256*141) on a Solaris 2.5 system with QA Partner 4.0.  It appears that no part of the requested command line is performed.  No console output is detected.  The phrase "Broken Pipe" appears on the real console session. The problem is more likely when the system is under load, or the program being invoked is large.
Solution - The following three steps may be needed. First, you will need to recover from the SYS_Execute function calls that do nothing.  To do this, write a function called UNIX_Execute that calls SYS_Execute.  In that function detect return values of 141 and 36096.  If these values are returned, issue the SYS_Execute again.  Replace your other calls to SYS_Execute to call the new function for UNIX platforms. You may want to issue a message when this happens or limit the number of times that you try to recover.  As a second step, you can write a shell script that sends an immediate message to the console output before it calls the real command line you wanted to invoke. This seems to satisfy the race condition to establish the pipe most of the time.  You will want to remove this extra message within your UNIX_Execute function, so it will appear to have not happened.  If after these two steps you still  get a 36096 return code every time, not just intermittently, you may need to "re-cycle" your UNIX system.

SYS_Execute function on UNIX splits returned lsConsole lines at 255 characters

When the SYS_Execute function returns console output on a Solaris 2.5 system with QA Partner 4.0 it splits each line that exceeds 255 characters.  The 255th character is also deleted.
Solution - None. If you need to process or verify the console output, be aware of the potential for split lines and missing characters.

SYS_Execute function can hang test execution

If the SYS_Execute function invokes a program that does not return, then the test script and QA Partner will be hung.  Even the clicking the Abort button or pressing the two shift keys do not work until control is returned by the called program.  This behavior is required in order for the SYS_Execute to return the console output and the return code.

If you think your UNIX partner is hung, press enter from the xterm that 'partner&' was started from, you should see a message mentioning "Stopped (SIGTTIN)" if it is hung waiting for input.  If so, you will need to KILL the partner process.  If you selected Runtime options to print agent calls and write immediate results lines, you should find the responsible SYS_Execute function with its command line at the end of the .jou file in your results directory.
Solution - You need to be especially careful that any program or command that you invoke does not prompt for input.  Make sure that you specify any extra optional parameters to specify behavior to avoid any need for a prompt.  If the program being executed requires input, a file containing the predicted input responses can be piped as standard input to the program when it is executed. Even in situations where you expect no input to be needed, you may want to pipe an input file with whatever command would end the program if an error causes a message prompt.

    SYS_Execute("yourprogram yourparms <yourfileofinput")

 

 

Send questions or comments about this web site to: webmaster@TestMap.com
Copyright © 1998,2001 Charles B. Hedstrom