jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Koopmans <>
Subject Re: Coding JMeter tests
Date Wed, 12 Nov 2014 22:16:30 GMT
This was my motivation for creating a DSL

Simplistically your test plans look like this:

test do
  threads count: 10 do
    visit name: 'Google Search', url: ''

It's proved pretty popular with a lot of our 'developer' type clients .. I
think the real value is being able to version control / share source to
tests in an easier to read format.

It's based in Ruby but I don't see why it couldn't be replicated in other
languages if that was your fancy ..

I think another blocker for developer types at least in the Ruby space is
the need to think about performance tests at the protocol level. Initially
it's a bit of a pain for devs switching context from writing tests purely
at the DOM level (webdriver equivalent) and then having to think about what
that translates into in terms of HTTP. Once again I use the DSL to try and
make this easier for example xpath (or css) selectors for elements:

visit name: 'Google', url: "" do
  extract regex: 'aria-label="(.+?)"', name: 'button_text'
  extract xpath: '//button', name: 'button'end

Another example is filling forms, pretty common requirement so I mimicked
the capybara style:

submit name: 'Submit Form', url: '',
  fill_in: {
    username: 'tim',
    password: 'password',
    'csrf-token' => '${csrf-token}'

That's my take -- making it easier to write and share tests in just a text
editor ..


Tim Koopmans

[image: Flood IO Pty Ltd] <>

Level 27, 101 Collins Street
Melbourne, Vic 3000

On Thu, Nov 13, 2014 at 3:42 AM, Deepak Shetty <> wrote:

> My 2 cents in no coherent order and with a heavy dose of bias.
> *"If we scope the discussion (for simplicity) to Java developers, I believe
> that if they take JMeter as a library or a framework, which will live
> inside the IDE, so it allows them to write tests in Java code and some
> mechanism to run those tests, it will increase the attraction of JMeter in
> the eyes of developers."*
> 1) I believe that such developers are the ones who mainly believe in the
> Unit Test cases are really, really important type (usually those who have
> looked at Agile or XP rather than reading up on testing in general)
> it follows then that running the tests within the IDE is also important -
> As such you could ask your developers to use JWebUnit + JUnitPerf  or
> Grinder or equivalent and see how well they take to it (my guess if your
> above observation is accurate would be not well - mainly because functional
> and integration end to end tests are hard to do). The developers who truly
> believe that tests (functional, integration and load) are important don't
> care about the number of GUIs (or indeed the number of different test tools
> that you actually have to use )
> 2) I remember awhile ago someone had asked for the ability of JMeter to be
> embeddable in a program and sebb had replied that it would be a major
> architectural change.I think the feature would be nice to have - but I
> don't believe it would increase adoption the way you think it would.
> 3) I don't think developers see that much value in testing when the tests
> are hard to do (which is why I believe so much literature is wasted on Unit
> Test cases - the lowest hanging fruit) - A lot of devs I know pay lip
> service to the importance of testing and then go on doing whatever they
> normally do - i.e. check a couple of things manually and then pass the buck
> to the testing team.
> The other problem I have as a developer is that if I haven't thought of
> something while coding it , I'm unlikely to come up with a test case for it
> - So If for e.g. I haven't thought that a particular value is optional, and
> so haven't  coded a null check , I'm unlikely to write a test case for that
> specific scenario and all my code coverage tools show good coverage (no
> branch for null and no test case for that either) - so Im not sure whether
> its a good thing to rely only on developers (the temptation is present
> whenever someone says I have N000 tests running and all passed!).
> regards
> deepak
> On Wed, Nov 12, 2014 at 5:29 AM, Shmuel Krakower <>
> wrote:
> > Hi all,
> > For a long time I'm struggling to push JMeter to the hands of developers
> > within the different development teams I'm working with. Today some of
> > those developer know and use JMeter, because it is part of our processes
> > (to performance test as much as possible), but they are not happy to take
> > such JMeter tasks.
> >
> > I was discussing this today with one of my colleagues, our pain is that
> > JMeter fail to be considered 'sexy', by most developers.
> > This is true especially when you look at the recent years changes where
> > developers are also taking care for end user / functional testing
> > development using frameworks such as cucumber.
> >
> > It feels like there's a lot of hype and 'cool'-ness (and fun) about
> > functional testing as part of agile methods and continuous deployment
> > efforts, but not once it comes to performance testing.
> >
> > I believe that the most immediate blocker is that JMeter takes the
> > developer outside of his comfort zone, outside of the IDE. JMeter
> > considered as a 'tool'.
> >
> > If we scope the discussion (for simplicity) to Java developers, I believe
> > that if they take JMeter as a library or a framework, which will live
> > inside the IDE, so it allows them to write tests in Java code and some
> > mechanism to run those tests, it will increase the attraction of JMeter
> in
> > the eyes of developers.
> >
> > Technically speaking, I guess it should be relative easy to utilize
> JMeter
> > from Java code, so a developer could nicely 'develop' tests and run them
> as
> > ANT / MVN task. Mainly because there are already such integrations to run
> > JMeter tests from within the IDE and because JMeter is written in Java -
> > thus why not using the Java API to create scripts via code?
> >
> > I just googled for that and found this post by blazemener:
> > http://blazemeter
> > .com/blog/5-ways-launch-jmeter-test-without-using-jmeter-gui
> > Where point 4 talks about exactly the same thing.
> > Does anyone has experience with this approach? Pros and Cons? Ideas?
> >
> > I don't mean that load tests should run from the IDE, but developers
> should
> > be able to develop scripts and run them (for testing) in their comfort
> > zone. The load tests execution should surely run later from a dedicated
> > environment / machines.
> >
> > This is mostly for discussion and as it is based on my own experience and
> > my own thoughts, I might be completely wrong here with my feelings and
> > assumptions, but would be nice to hear other thoughts on that topic.
> >
> > Best,
> >
> > Shmuel Krakower.
> > - re-use your jmeter scripts for application performance
> > monitoring from worldwide locations for free.
> >

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message