6 messages in com.canoo.lists.webtestRe: [WebTest] Using Verifier in JMeter
FromSent OnAttachments
eric.frigot24 Aug 2006 01:27 
eric.frigot24 Aug 2006 02:19 
Marc Guillemot24 Aug 2006 04:14 
eric.frigot25 Aug 2006 01:17 
Marc Guillemot25 Aug 2006 02:32 
eric.frigot25 Aug 2006 06:32 
Subject:Re: [WebTest] Using Verifier in JMeter
From:Marc Guillemot (mgui@yahoo.fr)
Date:08/25/2006 02:32:39 AM
List:com.canoo.lists.webtest

Hi Eric,

this sounds good.

Why do you need expandProperties() and verifyParameters()? Can you show a code snippet using your verififiers?

expandProperties will disappear after release 2.1 as we will use better ant. #{} properties will be expanded before the values are set on the steps what will allow the step properties to have the type they should have (ie boolean, int, String, ... and not just String).

Marc.

eric.frigot wrote:

Hi Eric,

if you're successful, don't hesitate to post your results back. The verifiers have never been meant for this purpose but if you see that small adaptations would facilitate reuse without burden for WebTest, let met know.

Well, first results are interresting. For the CheckBox verifier, I do something like that in the getResult method of a class extending AbstractTestElement (in JMeter) :

// Setting response ContextStub context = new ContextStub(inResponse.getResponseData(), inResponse.getContentType());

// Initializing Verifier VerifyCheckbox step = new VerifyCheckbox(); // ... set here parameters

// Executing verification try { StepExecutor.executeStep(step); } catch (StepFailedException sfe) { result.setFailure(true); result.setFailureMessage(sfe.getMessage()); } catch (Exception e) { result.setFailure(true); result.setFailureMessage(e.getMessage()); }

Where result is a JMeter object and StepExecutor :

package com.canoo.webtest.steps;

public class StepExecutor { public static void executeStep(final Step step) throws Exception { step.expandProperties(); step.verifyParameters(); step.doExecute(); } }

The only way to access expandProperties and verifyParameters is to make such class (in a canoo package).

Is there another way to do that well ?

As you see, using Canoo WebTest verifiers in JMeter is not difficult. I am making GUI components and implementing all verifiers.

Another idea would be to "export" from WebTest to jMeter format (perhaps with a module "listening" to the execution of a test and generating a JMeter file more intelligently than a proxy).

The reason why i choose to make such plugin come from Calypso GUI which does not seem to record behind a proxy.

I don't think it is possible to export from WebTest to JMeter because JMeter cannot accees HTML Form with their names or id.

Marc.

eric.frigot wrote:

The solution is simple : just use the ContextStub Class which can take a string representation of an HTML Page and do all the necessary initialisations.

If this plugin is usefull, i will post a feedback here and on JMeter.

Hi there,

I am working on load tests and unit test. JMeter seems to be enough good for the load tests and Canoo WebTest has interesting verifiers.

As I want to simplify testing process, I am trying to only use JMeter. But it does not define verifiers like WebTest does.

It does not seam very difficult to develop a JMeter Plugin. So I look in WebTest source code to see possible use of its verifiers. I am not sure that I can easily use them outside WebTest.

The Context class contains the html pages, but which attributes must be set to use the verifiers?

Does anyone try to do something like that?

Thanks.

Cet été, pensez aux cartes postales de laposte.net !

Cet été, pensez aux cartes postales de laposte.net !