You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by SanderW <sa...@performancearchitecten.nl> on 2014/11/21 08:23:24 UTC

Recording: Variable from User Defined Variables in Patterns to Include

Hi,

In my testplan I have a User Defined Variables with a Host.
During my recording I only want to record requests that belong to that host.

If the host is a ip-address I use "\b(?:\d{1,3}\.){3}\d{1,3}\b.*" in the URL
Patters to Include and that works fine. 

But want I really want is to record only urls that have the same host as I
defined in the User Defined Variables. I tried several Regular Expressions,
but nothing gets recording so I must be doing something wrong.

What is the correct way to do this?

Kind Regards



--
View this message in context: http://jmeter.512774.n5.nabble.com/Recording-Variable-from-User-Defined-Variables-in-Patterns-to-Include-tp5721390.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Recording: Variable from User Defined Variables in Patterns to Include

Posted by Britto C <br...@gmail.com>.
Try using HTTP request defaults and mention the hostname variable mention
in your user defined filed

On Fri Nov 21 2014 at 12:54:21 PM SanderW <sa...@performancearchitecten.nl>
wrote:

> Hi,
>
> In my testplan I have a User Defined Variables with a Host.
> During my recording I only want to record requests that belong to that
> host.
>
> If the host is a ip-address I use "\b(?:\d{1,3}\.){3}\d{1,3}\b.*" in the
> URL
> Patters to Include and that works fine.
>
> But want I really want is to record only urls that have the same host as I
> defined in the User Defined Variables. I tried several Regular Expressions,
> but nothing gets recording so I must be doing something wrong.
>
> What is the correct way to do this?
>
> Kind Regards
>
>
>
> --
> View this message in context: http://jmeter.512774.n5.
> nabble.com/Recording-Variable-from-User-Defined-Variables-
> in-Patterns-to-Include-tp5721390.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: Recording: Variable from User Defined Variables in Patterns to Include

Posted by SanderW <sa...@performancearchitecten.nl>.
sebb-2-2 wrote
> Yes.
> But you don't say what you have tried so it's impossible to debug the
> issue.

Sorry, you are right.

I have a variable called "Env" with value "acp" in User Defined Variables.
In the Test Script Recorder I have tried the following URL Patterns to
Include:
.*.(tst|acp).somehost.nl.*     --> Works. The .* at the beginning is because
of the application name that the urls start with
.*.${Env}.somehost.nl.*     --> Does not work
.*.\${Env}.somehost.nl.*     --> Does not work
.*${__BeanShell(vars.get("Env"))}.somehost.*     --> Does not work

I tried escaping the $ { and }, but that didn't work.
I also tried to debug with ${__log(vars.get("Env"))}, but that also does not
do anything in URL Patterns to Include






--
View this message in context: http://jmeter.512774.n5.nabble.com/Recording-Variable-from-User-Defined-Variables-in-Patterns-to-Include-tp5721390p5721565.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Recording: Variable from User Defined Variables in Patterns to Include

Posted by sebb <se...@gmail.com>.
On 21 November 2014 07:23, SanderW <sa...@performancearchitecten.nl> wrote:
> Hi,
>
> In my testplan I have a User Defined Variables with a Host.
> During my recording I only want to record requests that belong to that host.
>
> If the host is a ip-address I use "\b(?:\d{1,3}\.){3}\d{1,3}\b.*" in the URL
> Patters to Include and that works fine.
>
> But want I really want is to record only urls that have the same host as I
> defined in the User Defined Variables. I tried several Regular Expressions,
> but nothing gets recording so I must be doing something wrong.

Yes.
But you don't say what you have tried so it's impossible to debug the issue.

> What is the correct way to do this?

> Kind Regards
>
>
>
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/Recording-Variable-from-User-Defined-Variables-in-Patterns-to-Include-tp5721390.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Recording: Variable from User Defined Variables in Patterns to Include

Posted by SanderW <sa...@performancearchitecten.nl>.
Hi Glinius,

The only thing that is different is that "somehost" is replaced by the
company name I'm currently working as an external. I don't know if they like
it when I place their name here.

The rest of the hostname is exactly how it is, but for a working example use
the attached jmx-file.
JMeter_URL_Patterns_to_Include.jmx
<http://jmeter.512774.n5.nabble.com/file/n5721568/JMeter_URL_Patterns_to_Include.jmx>  

The goal is to use the variable from the User Defined Variable in the URL
Patterns to Include, like jmeter.${Env}.n5.nabble.com.*



--
View this message in context: http://jmeter.512774.n5.nabble.com/Recording-Variable-from-User-Defined-Variables-in-Patterns-to-Include-tp5721390p5721568.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org