Unofficial Content

Objective: How to build stress test scripts for testing GeneXus Applications.
In this case we used Apache Jmeter Stress Test tool, which has very complete documentation.

Introduction: In general you have to define which parts of the application are convenient to include in the set of tests. Include listeners in order to trace the results, and add different settings like "timing" in order to make the simulation more real. All that information can be found in the Apache Jmeter online documentation.

We divided the document into two parts, as there is a little difference in the way the test scripts have to be built in Java/Net and Ruby generator. The difference in the generators resides in the way the response is sent from the server to the client, as a consequence, there has to be a subtle difference in the way the stress test scripts are built.

Ruby Generator stress test scripts
Java/NET stress test scripts

Considerations

Whenever possible enable the Javascript debug mode property to ease the usage of parameters in JMeter tool.

The Javascript debug mode property is used on the client-side to encrypt or not some POST parameters. The following Request URL is a sample showing the usage of the property:

// Javascript Debug Mode: Yes
http://{server}:{port}/{webappname}/servlet/com.{kbname}.{objectname}?gxfullajaxEvt,gx-no-cache=1442811265833
// Javascript Debug Mode: No (default value)
http://{server}:{port}/{webappname}/servlet/com.{kbname}.{objectname}?64df96a2d9b8480aed416e470dae529e,gx-no-cache=1442811265833

The first parameter "64df96a2d9b8480aed416e470dae529e" is the encrypted value for the "gxajaxEvt" text.
The second parameter "1442811265833" is a timestamp automatically generated to disable cache from the server side.

Conclusion

The same core steps have to be followed in any generator to build a set of stress test scripts; depending on the tool to be used and the characteristics of the application, an analysis has to be done to automate those tests. In the case of the Ruby generator some extra considerations have to be taken into account.
Post requests are a little more difficult to be automated, but there's a simple technique to get the parameters that are sent in the body of the request to use them in the scripts.

Known Errors

The following error appears when generating a script with JMeter:

java.util.zip.ZipException: Not in GZIP format 
    at java.util.zip.GZIPInputStream.readHeader(Unknown Source) 
    at java.util.zip.GZIPInputStream.<init>(Unknown Source) 
    at java.util.zip.GZIPInputStream.<init>(Unknown Source) 
    at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.readResponse(HTTPJavaImpl.java:272) 
    at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sample(HTTPJavaImpl.java:516) 
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62) 
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1018) 
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1004) 
    at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:411) 
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:297) 
    at java.lang.Thread.run(Unknown Source) 

 

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant