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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -