Quantcast
Channel: Silk Test Knowledge Base
Viewing all articles
Browse latest Browse all 105

Sys_Execute() of a batch file with a TIMEOUT does not run in invisible mode

$
0
0
Current Revision posted to Silk Test Knowledge Base by ColinM on 10/27/2016 10:12:32 AM

When attempting to execute a batch file which includes a TIMEOUT in invisible mode using the Sys_Execute() function, then the batch file will not run and Silk Test proceeds to the next step in the script. 

This is known limitation with using a TIMEOUT in a batch file and is not an issue caused by Silk Test.

When TIMEOUT is executed in a background batch script, it will result in "ERROR: Input redirection is not supported, exiting the process immediately.". The TIMEOUT command will run OK in a console or terminal session.

When TIMEOUT is executed, it tries to redirect the input. The command is waiting for the user to interrupt the wait period. This is not possible if the command is executed in the background(invisible mode). It does not have any possibility of retrieving input and fails immediately. This is as designed for the TIMEOUT command in Windows.

You can verify this by returning the output from the command line using Sys_Execute()

[ ] LIST OF STRING lsOutPut
     [ ]
     [ ] Sys_Execute("C:\cmd.bat", lsOutPut)
     [ ]
     [ ] print(lsOutPut)


This should return the error "ERROR: Input redirection is not supported, exiting the process immediately" in the Silk Test results. 

To workaround this will have to use "start" in your command line. Alternatively, if you are looking to use  TIMEOUT in a batch script to add a delay to your script, you can simply use a Sleep() call in your 4Test code instead to add a delay.

[ ] LIST OF STRING lsOutPut
     [ ] 
     [ ] Sys_Execute("start C:\cmd.bat", lsOutPut)
     [ ] 
     [ ] print(lsOutPut)

Tags: Silk Test Classic, 4Test, Silk Test, batch, timeout, sys_execute()

Viewing all articles
Browse latest Browse all 105

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>