'How to enter Y when prompted using Jmeter OS process Sampler
I am currently stuck with executing a command to transfer some file using Jmeter OS process sampler. The transfer is facilitated by a EXE file which I need to invoke and then provide the route and the file names to make that transfer happen along with a Secure Key.
I am successfully able to execute the command but this command when executed prompts the below
Press Y to continue...
I tried a number of ways to pass the input as Y but its doesn't seem to work. I have tried the below options
- Echo Y
- / set /y
- /Q to suppress the prompt
- Created a bat file to echo y and then called it out from the OS sampler
- Added the whole piece of command to the bat file and then echoed y
and there were few other combinations I tried but it does not seem to work.
If I provide a command in multiple lines of the OS process sampler, it simply appends to the previous command.
Any pointer would really help me out.
PS:- I did go through a number of links one of them was the below.
https://www.blazemeter.com/blog/how-run-external-commands-and-programs-locally-and-remotely-jmeter
Solution 1:[1]
Here is an example on how to delete file c:\temp\test.txt
More information:
- How to auto answer prompts in Windows batch script
- Redirecting Input and Output
- How to Run External Commands and Programs Locally and Remotely from JMeter
Also there are 4 error messages in your script, check jmeter.log file for any suspicious entries as it might be the case your JSR223 Pre-Processor is failing.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dmitri T |




