Issue
This is the code I want to launch with Jenkins :
start cmd.exe /k "node "C:\Program Files\Appium\node_modules\appium\bin\appium.js" -a 127.0.0.1 -p 4723"
ping 127.0.0.1 -n 30 > nul
C:\path\NUnit-2.6.4\NUnit-2.6.4\bin\nunit-console.exe C:\path\NUnit-2.6.4\NUnit-2.6.4\bin\apk\UnitTestProject1.dll
This is the error I get every time I try to put a pause:
"ERROR: Input redirection is not supported, exiting the process immediately."
Same error with timeout /T 60
and sleep 60
According to this post , timeout does not work in non-interactive scripts.
How can I add a pause in my situation ?
Edit for Will Ryan :
I try this :
The build worked, but the test duration is only 0.5 seconds, the pause doesn't do anything
The console output is :
C:\Program Files\Jenkins\jobs\ZFAIL\workspace>echo "--"
"--"
C:\Program Files\Jenkins\jobs\ZFAIL\workspace>PING 1.1.1.1 -n 1 -w 30000 1>NUL
C:\Program Files\Jenkins\jobs\ZFAIL\workspace>echo "++"
"++"
C:\Program Files\Jenkins\jobs\ZFAIL\workspace>exit 0
Finished: SUCCESS
Solution
I think you can use the following command in Execute Windows batch command (will wait for 100 seconds):
waitfor SomethingThatIsNeverHappening /t 100
This will return an error which could break your build. To avoid that, redirect the error output:
waitfor SomethingThatIsNeverHappening /t 100 2>NUL
Answered By - Yauheni Basalai
Answer Checked By - Mildred Charles (JavaFixing Admin)