SPONSORS:






View RSS Feed

Ronak

Understanding JMeter Element- OS Process Sampler

Rate this Entry
by , 06-21-2015 at 02:26 AM (2378 Views)
Understanding JMeter Element- OS Process Sampler

The OS Process Sampler is a sampler that can be used to execute commands on the local machine.
It should allow execution of any command that can be run from the command line.

Validation of the return code can be enabled, and the expected return code can be specified.

Note that OS shells generally provide command-line parsing. This varies between OSes, but generally the shell will split parameters on white-space. Some shells expand wild-card file names; some don't. The quoting mechanism also varies between OSes. The sampler deliberately does not do any parsing or quote handling. The command and its parameters must be provided in the form expected by the executable. This means that the sampler settings will not be portable between OSes.

Many OSes have some built-in commands which are not provided as separate executables. For example the Windows DIR command is part of the command interpreter (CMD.EXE). These built-ins cannot be run as independent programs, but have to be provided as arguments to the appropriate command interpreter.

For example, the Windows command-line: DIR C:\TEMP1 needs to be specified as follows:
command: CMD
Param 1: /C
Param 2: DIR
Param 3: C:\TEMP1

Parameters

Command- The program name to execute.
Working directory- Directory from which command will be executed, defaults to folder referenced by "user.dir" System property
Command Parameters- Parameters passed to the program name.
Environment Parameters- Key/Value pairs added to environment when running command.
Standard input (stdin) - Name of file from which input is to be taken (STDIN).
Standard output (stdout) - Name of output file for standard output (STDOUT). If omitted, output is captured and returned as the response data.
Standard error (stderr) - Name of output file for standard error (STDERR). If omitted, output is captured and returned as the response data.
Check Return Code- If checked, sampler will compare return code with Expected Return Code.
Expected Return Code- Expected return code for System Call, required if "Check Return Code" is checked.
Timeout- Timeout for command in milliseconds, defaults to 0, which means NO timeout. If the timeout expires before the command finishes, JMeter will attempt to kill the OS process.



Disclaimer: The article/post is posted with the purpose of sharing knowledge and information.
The article may contain references, extract or content from other informative sources.
Researched/Authored/Compiled by -
Ronak Shah
Practice Head - Software Testing (QA), CIGNEX Datamatics

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:25 AM.

Copyright BetaSoft Inc.