You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by Jmeter Tea <jm...@gmail.com> on 2018/08/28 13:03:59 UTC

Adding script before loading configuration

Hello,

Many times users expect to setup configuration elements before execution
(as below question)
I wonder if we can add a option to run a JSR223 script on load or before
executing a run to setup some variables/properties that can be used in
configuration elements

Thank you

https://stackoverflow.com/questions/52058206/using-property-variable-value-from-jenkins

Re: Adding script before loading configuration

Posted by Jmeter Tea <jm...@gmail.com>.
Hi

Setup thread group doesn't work, for example, HTTP Header Manager with
variables can't be set with User Parameters in setup thread group (although
variables are set ok)

On Wed, Aug 29, 2018 at 2:10 AM sebb <se...@gmail.com> wrote:

> On 28 August 2018 at 19:40, Philippe Mouawad <ph...@gmail.com>
> wrote:
> > Hello,
> > This exists currently with Beanshell and I agree this should be possible
> > with JSR223 as we advise to move out from Beanshell and it's the last
> place
> > where Beanshell is needed.
>
> I don't think that's quite true.
>
> Beanshell allows the user to set up a server that can be used to
> access the internals of JMeter at run-time.
> It's not secure, so should only be used on a suitably protected
> system, but it can be very useful at times, especially for very
> long-running tests.
>
> I don't think JSR223 allows that currently.
> It may (or may not) be possible with other scripting languages.
>
> > Property:
> >
> >    - beanshell.init.file=
> >
> >
> > See JMeter#startOptionalServers
> >
> > So if you propose a patch, I'll be happy to merge it.
>
> Note that a startup script could be done by using a startup thread group.
> Such groups did not exist when beanshell was first added, so that was
> not an option then.
>
> > Regards
> >
> > On Tue, Aug 28, 2018 at 3:04 PM Jmeter Tea <jm...@gmail.com> wrote:
> >
> >> Hello,
> >>
> >> Many times users expect to setup configuration elements before execution
> >> (as below question)
> >> I wonder if we can add a option to run a JSR223 script on load or before
> >> executing a run to setup some variables/properties that can be used in
> >> configuration elements
>
> Try using a setup thread group.
>
> >>
> >> Thank you
> >>
> >>
> >>
> https://stackoverflow.com/questions/52058206/using-property-variable-value-from-jenkins
> >>
> >
> >
> > --
> > Cordialement.
> > Philippe Mouawad.
>

Re: Adding script before loading configuration

Posted by Philippe Mouawad <ph...@gmail.com>.
Setup thread group would not work for a user needing some init code for
recording.

On Wednesday, August 29, 2018, sebb <se...@gmail.com> wrote:

> On 28 August 2018 at 19:40, Philippe Mouawad <ph...@gmail.com>
> wrote:
> > Hello,
> > This exists currently with Beanshell and I agree this should be possible
> > with JSR223 as we advise to move out from Beanshell and it's the last
> place
> > where Beanshell is needed.
>
> I don't think that's quite true.
>
> Beanshell allows the user to set up a server that can be used to
> access the internals of JMeter at run-time.
> It's not secure, so should only be used on a suitably protected
> system, but it can be very useful at times, especially for very
> long-running tests.
>
> I don't think JSR223 allows that currently.
> It may (or may not) be possible with other scripting languages.
>
> > Property:
> >
> >    - beanshell.init.file=
> >
> >
> > See JMeter#startOptionalServers
> >
> > So if you propose a patch, I'll be happy to merge it.
>
> Note that a startup script could be done by using a startup thread group.
> Such groups did not exist when beanshell was first added, so that was
> not an option then.
>
> > Regards
> >
> > On Tue, Aug 28, 2018 at 3:04 PM Jmeter Tea <jm...@gmail.com> wrote:
> >
> >> Hello,
> >>
> >> Many times users expect to setup configuration elements before execution
> >> (as below question)
> >> I wonder if we can add a option to run a JSR223 script on load or before
> >> executing a run to setup some variables/properties that can be used in
> >> configuration elements
>
> Try using a setup thread group.
>
> >>
> >> Thank you
> >>
> >>
> >> https://stackoverflow.com/questions/52058206/using-
> property-variable-value-from-jenkins
> >>
> >
> >
> > --
> > Cordialement.
> > Philippe Mouawad.
>


-- 
Cordialement.
Philippe Mouawad.

Re: Adding script before loading configuration

Posted by sebb <se...@gmail.com>.
On 28 August 2018 at 19:40, Philippe Mouawad <ph...@gmail.com> wrote:
> Hello,
> This exists currently with Beanshell and I agree this should be possible
> with JSR223 as we advise to move out from Beanshell and it's the last place
> where Beanshell is needed.

I don't think that's quite true.

Beanshell allows the user to set up a server that can be used to
access the internals of JMeter at run-time.
It's not secure, so should only be used on a suitably protected
system, but it can be very useful at times, especially for very
long-running tests.

I don't think JSR223 allows that currently.
It may (or may not) be possible with other scripting languages.

> Property:
>
>    - beanshell.init.file=
>
>
> See JMeter#startOptionalServers
>
> So if you propose a patch, I'll be happy to merge it.

Note that a startup script could be done by using a startup thread group.
Such groups did not exist when beanshell was first added, so that was
not an option then.

> Regards
>
> On Tue, Aug 28, 2018 at 3:04 PM Jmeter Tea <jm...@gmail.com> wrote:
>
>> Hello,
>>
>> Many times users expect to setup configuration elements before execution
>> (as below question)
>> I wonder if we can add a option to run a JSR223 script on load or before
>> executing a run to setup some variables/properties that can be used in
>> configuration elements

Try using a setup thread group.

>>
>> Thank you
>>
>>
>> https://stackoverflow.com/questions/52058206/using-property-variable-value-from-jenkins
>>
>
>
> --
> Cordialement.
> Philippe Mouawad.

Re: Adding script before loading configuration

Posted by Philippe Mouawad <ph...@gmail.com>.
Hello,
This exists currently with Beanshell and I agree this should be possible
with JSR223 as we advise to move out from Beanshell and it's the last place
where Beanshell is needed.
Property:

   - beanshell.init.file=


See JMeter#startOptionalServers

So if you propose a patch, I'll be happy to merge it.
Regards

On Tue, Aug 28, 2018 at 3:04 PM Jmeter Tea <jm...@gmail.com> wrote:

> Hello,
>
> Many times users expect to setup configuration elements before execution
> (as below question)
> I wonder if we can add a option to run a JSR223 script on load or before
> executing a run to setup some variables/properties that can be used in
> configuration elements
>
> Thank you
>
>
> https://stackoverflow.com/questions/52058206/using-property-variable-value-from-jenkins
>


-- 
Cordialement.
Philippe Mouawad.