Skip to main content

Posts

Showing posts from January, 2015

Jmeter : Adding Perfmon Metrics to Jmeter

To add Perform Plugins into Jmeter we need to copy "JMeterPlugins-Standard.jar" under lib/ext directory. This brings some more features of Perfmon as below:


More details about the plugin can be found @ http://jmeter-plugins.org/wiki/PerfMonAgent/
Using this we can capture the Server side metrics like CPU, Memory,Disk I/O, Network I/O ..etc.
To collect all the Metrics using PerfMon we need to add On TestPlan -> Add -> Listener -> "jp@gc - PerfMon Metrics Collector".
Specific the Host/IP, Port, Metric to Collect and filename to store the results as shown below:
We can also add other Listeners also.
Some important ones to add are as below:



JMeter : Error while loading TestPlan - "Unexpected Error -see log"

I tried to open a test plan (.jmx file) in JMeter which was created by one of my colleague. The error said “Unexpected error – see log for details”.


2015/01/29 15:30:30 INFO  - jmeter.save.SaveService: All converter versions present and correct 2015/01/29 15:30:30 ERROR - jmeter.protocol.java.config.gui.JavaConfigGui: Error setting class:'com.nft.sampler. AdministratorSampler' in JavaCustomerAdministrator, check for a missing jar in your jmeter 'search_paths' and 'plugin_dependency_paths' properties 2015/01/29 15:30:30 ERROR - jmeter.protocol.java.config.gui.JavaConfigGui: Error setting class:'com.nft.sampler. CustomerSampler' in JavaSampler Customer, check for a missing jar in your jmeter 'search_paths' and 'plugin_dependency_paths' properties 2015/01/29 15:30:30 ERROR - jmeter.protocol.java.config.gui.JavaConfigGui: Error setting class:'com.nft.sampler. InvolvementSampler' in JavaSampler Involvement, check for a missing jar in y…

JMeter :Error while loading TestPlan - See Log File

Today, I tried to open a test plan (.jmx file) in JMeter which was created by one of my colleague. The error said “Empty TestPlan – see log file”.
The following error is present in Jmeter.log:
2015/01/29 15:20:50 INFO  - jmeter.gui.action.Load: Loading file: C:\Users\Desktop\jmeter\consolidatedayStability.jmx 2015/01/29 15:20:50 INFO  - jmeter.services.FileServer: Set new base='C:\Users\Desktop\jmeter' 2015/01/29 15:20:50 ERROR - jmeter.save.SaveService: Conversion error com.thoughtworks.xstream.converters.ConversionException: kg.apc.jmeter.vizualizers.CorrectedResultCollector : kg.apc.jmeter.vizualizers.CorrectedResultCollector ---- Debugging information ---- message             : kg.apc.jmeter.vizualizers.CorrectedResultCollector cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException cause-message       : kg.apc.jmeter.vizualizers.CorrectedResultCollector class               : org.apache.jorphan.collections.ListedHashTree required-type       : org.apache.j…

Parameters to set while starting JMeter.

Parameters to set while starting JMeter.
Steps:
Create a file startJmeter.cmd at location: “C:\Jmeter\apache-jmeter-2.9\apache-jmeter-2.9”Add the below lines to set different parameters.

set JNDI_CTX_FACTORY=-Djava.naming.factory.initial=weblogic.jndi.WLInitialContextFactory set JMX_PROVIDER=-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote
set HEAP=-server -Xms1024m -Xmx1024m set NEW=-XX:NewSize=512m -XX:MaxNewSize=512m set TENURING=-XX:MaxTenuringThreshold=2 set RMIGC=-Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000 set PERM=-XX:PermSize=128m -XX:MaxPermSize=128m set DEBUG=-verbose:gc -Xloggc:gc.log -XX:+PrintTenuringDistribution set JMETER_PLUGINS_CONFIG=-DjmeterPlugin.jmxmon.interval=2000 -DjmeterPlugin.perfmon.interval=2000
set JVM_ARGS=%HEAP% %NEW% %SURVIVOR% %TENURING% %RMIGC% %PERM% %DEBUG% %JNDI_CTX_FACTORY% %JMX_PROVIDER% %JMETER_PLUGINS_CONFIG%
java %JVM_ARGS% -jar .\bin\ApacheJMeter.jar
3. Double Click on startJmeter.cmd to launch Jmeter.

Dynamic boundaries

Dynamic boundaries:
Whenever we observe the dynamic value in the boundary use the below two approaches
1.Text flag: Using the text flag to handle the dynamic boundaries Text flags are the Flag used just after the text with Forward Slash. Some of the commonly known and used Text flags are: ·/IC to ignore the case ·/BIN to specify Binary Data ·/DIG to interpret the pound sign (#) as a wildcard for a single digit ·/ALNUM<case> to interpret the caret sign (^) as a wildcard for a single US–ASCII alphanumeric character
Let us discuss 4 common cases as examples below: Case 1: Digit Value Suppose the response data is the string literal, but the issue is that the left boundary is changing every time; you get the left boundary as axxb, where x ranges between 0 and 3, as follows: a01b=Correlatedrb
a12b=Correlatedrb
a23b=Correlatedrb

We can capture the desired string by putting the following correlation function in place, using the /DIG text flag in combination with Left Boundary: web_reg_save_param (“Par…

Hexadecimal Correlation

Hexadecimal Correlation Some times in our scripts the dynamic values which return from the server return with several variations, some values will return with a Hexadecimal sum of the value and some without. Hnadling these values or dynamic values using correlation:
§RB/BIN= should be used when Hexadecimal value is used in the boundary. §Hexadecimal value is returned from the server as \x07site_idt\x00, meaning with one back slash. §Additional back slash will need to be added to the correlated boundary as following \\x07site_idt\\x00. §The script should be tested with full log, by searching for the string StreamCorruptedException you may understand the error location and issue. §Also add global verification: web_global_verification("Text=java.io.StreamCorruptedException",    "Fail=Found", "ID=JavaStream", LAST);
Below you can find suggested way to correlate above statements: ■Without Hexadecimal sum:
Value to be correlated: //\\x07site_idt\x00  000006929t
Suggest…

Verifications and Error Handling in LoadRunner *Web_reg_find and Web_reg_save_param*

Verification's and Error HandlingVerification points must be inserted into the scripts to verify the application being tested with the load.
Verification function that are used in our application are:  Web_reg_find, web_reg_save_param
These verification should be outside towards the end of the transaction.

Mandatory verification points: ■Login – whenever there is a login, verification points must be added to verify that the user logged in correctly. ■Update Transactions – transactions that update the database must be verified that they are successful. ■Each page should be verified using Web_reg_find function
Using Web_reg_find for verifications.
Example: web_reg_find("Text= Main Package","SaveCount=Verify_Count1",LAST);
Verification: if (strcmp(lr_eval_string("{Verify_Count1}"),"0")==0) { lr_end_transaction("AddMainPackage", LR_FAIL);  lr_error_message("Iter %s: Add Main Package for Customer '%s' & UserName '%s' Fail…