jmeter - How can I get name of HTTP Request from field Name with BeanShell? -


i need variable field http request called name. if give examples how can other fields such : path, server name or ip using beanshell?

thank in advance

  1. add beanshell preprocessor child of request
  2. use following code lines required values:

    string name = sampler.getname(); // parent sampler name string path = sampler.geturl().getpath(); // path string url = sampler.geturl().gethost();  // ip or hostname 

    you can store values jmeter variables if required like

    vars.put("name", name); 

see how use beanshell: jmeter's favorite built-in component guide comprehensive information on using beanshell scripting in jmeter test.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -