Sara's Testing World :: ' i COMPLETE QUALiTY & TESTiNG '

Pages

  • Home
  • Testing Types
  • Certification
  • Forums /Blogs/ Sites
  • Interview Questions
  • Testing Tools
  • Automation
  • Selenium
  • Quality Management
  • Jobs
Showing posts with label Performance Testing Software /Tools. Show all posts
Showing posts with label Performance Testing Software /Tools. Show all posts

Wednesday, November 26, 2014

Top 15 Performance Testing Tools

Top 15 Performance Testing Tools
  • Apache JMeter
  • LoadRunner
  • WebLOAD
  • Appvance
  • NeoLoad
  • LoadUI
  • WAPT
  • Loadster
  • LoadImpact
  • Rational Performance Tester
  • Testing Anywhere
  • OpenSTA
  • QEngine (ManageEngine)
  • Loadstorm
  • CloudTest
  • Httperf

1. Apache JMeter

Apache JMeter
Description: Open source load testing tool: It is a Java platform application. It is mainly considered as a performance testing tool and it can also be integrated with the test plan. In addition to the load test plan, you can also create a functional test plan.  This tool has the capacity to be loaded into a server or network so as to check on its performance and analyze its working under different conditions. Initially, it was introduced for testing the web applications, but later its scope had widened.   It is of great use in testing the functional performance of the resources such as Servlets, Perl Scripts and JAVA objects.  Need JVM 1.4 or higher to run.
Apache JMeter System Requirements: It works under Unix and Windows OS
Download link: Apache JMeter download

2. LoadRunner

LoadRunner
Description: This is a HP product which can be used as a performance testing tool.  This can be bought as a HP product from its HP software division.  Also, it is very much useful in understanding and determining the performance and outcome of the system when there is actual load. One of the key attractive features of this testing tool is that, it can create and handle thousands of users at the same time. This tool enables you to gather all the required information with respect to the performance and also based on the infrastructure.  The LoadRunner comprises of different tools; namely, Virtual User Generator, Controller, Load Generator and Analysis.
LoadRunner System Requirements: Microsoft Windows and Linux are the favourable OS for this measuring tool.
Download link: LoadRunner download

3. WebLOAD

WebLOAD
Description: Load and performance testing tool for web applications. WebLOAD lets you perform load and stress testing on any internet application using Ajax, Adobe Flex, .NET, Oracle Forms, HTML5 and many more technologies. You can generate load from the cloud and on-premises machines. WebLOAD’s strengths are its ease of use with features like DOM-based recording/playback, automatic correlation and JavaScript scripting language. The tool supports large-scale performance testing with heavy user load and complex scenarios, and provides clear analysis on the functionality and performance of the web application. WebLOAD has 3500 users worldwide and has won various awards. Another highlight of the tool is its flexible licensing mechanism and pricing.
WebLOAD System Requirements: Windows, Linux
Download link: WebLOAD download

4. Appvance

Appvance
Description: Next Generation App Performance Testing Platform: Appvance PerformanceCloud is a broad-scale platform targeted at enterprise clients which can fully exercise apps from beginning (at the UX) to end. The platform is used to surface deep app and site issues from functional to load and stress and performance to APM. Unique designer functionality allows codeless test creation even from modern AJAX sites driving rapid productivity gains in SQA, and playback occurs on actual browsers in the cloud through the firms uxAvatar technology. Compatible with Selenium, JMeter, Dynatrace, Oracle Forms, Flash/Flex and more, and can test up to 10M concurrent users.
Appvance System Requirements:  Runs in private or public cloud
Demo link:  Appvance

5. NeoLoad

NeoLoad
Description: Load and performance testing software: This is a tool used for measuring and analyzing the performance of the website. The performance and the end result can be evaluated by using this tool and any further steps can be taken. This helps you in improving and optimizing the performance of your web application. This tool analysis the performance of the web application by increasing the traffic to the website and the performance under heavy load can be determined. You can get to know the capacity of the application and the amount of users it can handle at the same time. This tool was developed by a French company named as Netosys and it was written in JAVA.  It is available in two different languages; English and French.
NeoLoad System Requirements:  This tool is compatible on operating systems like Microsoft windows, Linux and Solaris.
Download link: NeoLoad download

6. LoadUI

LoadUI
Description: Open Source Stress Testing Tool: Load UI is yet another open source and load testing software used for measuring the performance of the web applications. This tool works effectively when it is integrated with the functional testing tool soapUI. LoadUI is the most flexible and interactive testing tools. This allows you to create, configure and update your tests while the application is being tested. It also gives a visual Aid for the user with a drag and drop experience. This is not a static performance tool. The advanced analysis and report generating features allows you to examine the actual performance by pumping in new data even while the application is being tested. You need not bother to restart the LoadUI each and every time you modify or change the application. It automatically gets updated in the interface.
System Requirements: Cross platform.
Price: This tool being a open source application, it is available for free and everyone can have the easy access to its full source code.
Download link: LoadUI download

7. WAPT

WAPT
Description: Performance testing tool for web sites and intranet applications: WAPT refers to the Web Application Performance tool.  These are scales or analyzing tools for measuring the performance and output of any web application or web related interfaces. These tools help us to measure the performance of any web services, web applications or for any other web interfaces. With this tool you have the advantage of testing the web application performances in various different environment and different load conditions. WAPT provides detailed information about the virtual users and its output to its users during the load testing. This is considered to be the best cost effective tool for analyzing the performance of the web services. The WAPT tools can tests the web application on its compatibility with browser and operating system. It is also used for testing the compatibility with the windows application in certain cases.
WAPT System Requirement: Windows OS is required for this testing tool.
Download link: WAPT download

8. Loadster

Loadster
Description: Loadster is a desktop based advanced HTTP load testing tool. The web browser can be used to record the scripts which is easy to use and record. Using the GUI you can modify the basic script with dynamic variables to validate response. With control over network bandwidth you can simulate large virtual user base for your application stress tests. After test is executed HTML report is generated for analysis. This tool is best to identify performance bottlenecks in your application.
Loadster System Requirements: Windows 7/Vista/XP
Download link: Loadster download

9. LoadImpact

LoadImpact
Description: LoadImpact is a load testing tool which is mainly used in the cloud-based services. This also helps in website optimization and improvising the working of any web application. This tools generates traffic to the website by simulating users so as to find the stress and maximum load it can work. This LoadImpact comprises of two main parts; the load testing tool and the page analyzer. The load testing can be divided into three types such as Fixed, Ramp up and Timeout. The page analyzer works similar to a browser and it gives information regarding the working and statistics of the website. The fame of developing this load testing tool belongs to Gatorhole AB. This is a freemium service which means that, it can be acquired for free and also available for premium price. But, you have the advantage of many options and features when you buy them for premium price.
------------
System Requirement: This works well on Windows OS and Linux.
Download link: LoadImpact download

10. Rational Performance Tester

Rational Performance Tester
Description: The Rational performance tester is an automated performance testing tool which can be used for a web application or a server based application where there is a process of input and output is involved. This tool creates a demo of the original transaction process between the user and the web service. By the end of it all the statistical information are gathered and they are analyzed to increase the efficiency. Any leakage in the website or the server can be identified and rectified immediately with the help of this tool. This tool can be the best option in building a effective and error free cloud computing service. This Rational Performance tester was developed by IBM (Rational software division). They have come up with many versions of this automated testing tool.
Rational Performance Tester System Requirement: Microsoft Windows and Linux AIX good enough for this performance testing tool.
Download link: Rational Performance Tester download

11. Testing Anywhere

Testing Anywhere
Description: Test Anywhere is a automated testing tool which can be employed for testing the performance of any web sites, web applications or any other objects. Many developers and testers make use if this tool to find out any bottlenecks in their web application and rectify them accordingly. It is a powerful tool which can test any application automatically. This testing tool comes along with a built in editor which allows the users to edit the testing criteria according to their needs. The testing anywhere tool involves 5 simple steps to create a test. They are object recorder, advanced web recorder, SMART test recorder, Image recognition and Editor with 385+ comments. Originally, this testing software was developed by San Jose based Automation Anywhere Inc. Today, there are more than 25000 users for this product.
Testing Anywhere System Requirement:   This tool is compatible with all versions of Windows OS.
Download link: Testing Anywhere download

12. OpenSTA

OpenSTA
Description: Open source HTTP performance test tools: Open STA stands for Open System Testing Architecture. This is a GUI based performance tool used by application developers for load testing and analyzing. This is believed to be a complex tool among the all other performance testing tools. It has proven capability in the past and the current toolset is capable of performing the heavy load test and analyses for the scripted HTTP and HTTPS. Here, the testing is carried out by using the recordings and simple scripts. To carry out the test successfully, results and other statistics are taken through various test runs. These data and results can be later exported to software for creating reports. This is a free testing tool and it is distributed under GNU GPL and it will remain free forever. This tool was originally developed by Cyrano, which was later taken over by Quotium.
OpenSTA System Requirement:  OpenSTA runs only on Windows operating system.
Download link: OpenSTA download

13. QEngine (ManageEngine)

QEngine (ManageEngine)
Description: QEngine (ManageEngine) is a most common and easy-to-use automated testing tool helping in performance testing and load testing of your web applications. Many developers find it to be the most simple and easy tool to use for finding out any leakage in their web services or websites. The key important feature of this testing tool is its ability to perform remote testing of web services from any geographical location. Other than that, QEngine (ManageEngine) also offers carious other testing options such as functionality testing, compatibility testing, stress testing , load testing and regression testing. This automated testing tool has the capacity to generate and simulate lot if users so that the performance can be well analyzed in the during the maximum load. This is a free software available for the users online.
QEngine System Requirement:  This tool works with the Microsoft Windows and Linux.
Download link: QEngine download

14. Loadstorm

Loadstorm
Description: Cloud load testing for web applications: Loadstorm is the cheapest available performance and load testing tool. Here, you have the option of creating your own test plans, testing criteria and testing scenario. You can generate up to 50000 concurrent users by generating traffic to your website and then carry out the testing. Through this tool, you can bring an end to all the expensive performance testing tools. The cloud infrastructure is used in this tool, which enables you to send huge amount of requests per second. There are thousands of servers available around the world for this software. They are proudly known as the lowest cloud load testing tool. There is no need of any scripting knowledge for using this tool. You will be provided with many graphs and reports which measures the performance in various metrics such as error rates, average response time and number of users. This tool is available for free, but the premium account comes with added features.
Loadstorm System Requirement:  Windows OS.
Download link: Loadstorm download

15. CloudTest

Soasta cloudtest
Description: SOASTA CloudTest is a performance testing tool for the cloud computers. The users or the developers can use the cloud platform as their virtual testing lab. The developers can carry out their per4formance or load testing in the cloud platform in the cost effective way through this CloudTest tool. This CloudTest has the capacity to enable number of users to use the website at the same time. It also increases the traffic of the website to know the actual performance under stress and heavy load. The credit of developing this software goes to an American Technology company, SOASTA Inc. They provide many services for testing the websites and other web applications and now they also help in testing the mobile applications. They are not free services, the price differs according to the number of load injector machines required per hour by you. The trial version with power of 100 concurrent users is available for free.
SOASTA CloudTest System Requirement:  It runs on Windows, Linux and Mac OS.
Download link: SOASTA CloudTest download
Plus one more:

16. Httperf

HTTPerf
Description: Httperf is a high performance testing tool for measuring and analyzing the performance of any web services and web applications. This is mainly used to the test the HTTP servers and its performance. The main objective of this testing tool would be to count the number of responses generated from this particular server. This generates the HTTP GET requests from the server which helps in summarizing the overall performance of the server. Through this tool, you will be able to conclude the rate at which the response is sent from each server and thereby the efficiency can be calculated. The ability to sustain the server overload, support the HTTP/1.1 protocol and compatibility with new workload are the three key features of this performance testing tool.  This was originally developed by David Mosberger and many others at HP. This is a Hewlett Packard product.
Httperf System Requirement: Windows and Linux.
Download link: Httperf download
Posted by The BASS at 2:25 AM No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: Performance Testing Software /Tools

Load and Performance Tools

Load and Performance Tools

  • BurnIn Test
  • Capacity Calibration
  • DTM DB Stress
  • FORECAST
  • Funk Load(freeware)
  • InternetWorking Test Facility
  • JBlitz Pro
  • JMeter
  • JUnitPref
  • LISA Load and Performance Testing Tool
  • LOAD
  • HP LoadRunner
  • LOADEA
  • Load Manager
  • NeoLoad
  • OpenLoad
  • PureLoad
  • QALoad
  • Network Performance Tool
  • QTest
  • Scapa Test and Performace Platform
  • Silk Performer – Load and Performance Testing
  • WAPT Load and Stress Testing Tool
  • WebLoad
  • Web Performance Suite
  • WebServer Stress Tool
Posted by The BASS at 1:15 AM No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: Performance Testing Software /Tools

Tuesday, May 20, 2014

Start with Jmeter

Jmeter Interview Questions

What is Jmeter?
JMeter is one of the Java tools which is used to perform load testing client/server applications. 
Apache JMeter is open source software, a 100% pure Java desktop application
designed to load test functional behavior and measure performance of the application.
It was originally designed for testing Web Applications but has since expanded to other test functions

What are the other applications tested by Jmeter? 
JMeter may be used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more)
What do u sees when u opens a JMeter?
By default,
Test Plan
Workbench
Can be seen
What is Test Plan in Jmeter?
Test plan describes a series of steps JMeter will execute when run.
A complete test plan will consist of one or more Thread Groups, logic conrollers, sample generating controllers, listeners, timers, assertions, and configuration elements.

What is Work bench?
The Workbench is simply an area to store test elements while you are in the process of constructing a test. 
The Workbench is a sandbox for any test or portion of a test that you are working on.
When you are ready to test what you have designed in the Workbench, you can copy or move the elements into the Test Plan.

It also contains Non- Test Elements
Http mirror sever
Http Proxy server
which is not available in the thread group & Test plan

What is Thread Group?
Thread group elements are the beginning points of any test plan.
  1. All controllers and samplers must be under a thread group. 
  2. Listeners may be placed directly under the test plan, in which case they will apply to all the thread groups. 
  3. The controls for a thread group allow you to:
  • Set the number of threads
  • Set the ramp-up period
  • Set the number of times to execute the test 

What are the parts of thread group?
  • Sampler :Sends various types of requests to the server
  • Listeners : Results of the Run can be viewed & saved
  • Timer : Makes the run more realistic by inserting delays between the requests
  • Controller : responsible for controlling the flow of the thread group.If we have defined request to be executed on some logic like if-then-else or loop structure in java
  • Config Element: Info about the requests are added to work with samplers using this.
  • Assertion: To check if the responses are within given time and containing expected data. 
What are Controllers and its types? 
JMeter has two types of Controllers

Samplers Controllers 
Logical Controllers 

Samplers Controllers 
Samplers tell JMeter to send requests to a server.
For example, add an HTTP Request Sampler if you want JMeter to send an HTTP request. You can also customize a request by adding one or more Configuration Elements to a Sampler.

Logical Controllers 

Logical Controllers let you customize the logic that JMeter uses to decide when to send requests.
Logic Controllers can change the order of requests coming from their child elements.
For example, you can add an Interleave Logic Controller to alternate between two HTTP Request Samplers.

What is Configuration element?
A configuration element works closely with a Sampler
Configuration elements can be used to set up defaults and variables for later use by samplers.
Note that these elements are processed at the start of the scope in which they are found, i.e. before any samplers in the same scope.

Its elements:
CSV Data Set Config: Used to read lines from a file, and split them into variables.
HTTP Authorization Manager: You can specify one or more user logins for web pages that are restricted using server authentication
Java Request Defaults: You can set default values for Java testing
HTTP Cookie Manager: The Cookie Manager element has two functions: 
1.                  It stores and sends cookies just like a web browser.
2.                  Second, you can manually add a cookie to the Cookie Manager. However, if you do this, the cookie will be shared by all JMeter threads
HTTP Request Defaults: This element lets you set default values that your HTTP Request controllers use.
HTTP Header Manager: The Header Manager lets you add or override HTTP request headers

What are Listeners?
A listener is a component that shows the results of the samples
The results can be shown in a tree, tables, graphs or simply written to a log file
The Graph Results listener plots the response times on a graph.
The "View Results Tree" Listener shows details of sampler requests and responses, and can display basic HTML and XML representations of the response.
Other listeners provide summary or aggregation information.

Every listener in JMeter provides a field to indicate the file to store data to.
They also provide means to view, save, and read saved test results.

Ques. Is the url in question. While I (think) I understand what this url is doing, what are my steps to test in JMeter? Any help appreciated.

Ans. The steps to test in Jmeter depend largely on what you're trying to test.
As a starting point, I would recommend recording logging into the site, so you capture every parameter that's being sent along with its value.You can then parametrize these values as needed. It looks like once someone logs in, they get redirected to another page. Mostly likely when you record, you'll see the login page and then a landing page captured.appreciate the response. what is happening is i am going from a somesite.com, click login, which directs to Subdomain.somesite.com/users/sign_in/service:accounts?redirect=/ at which point you enter credentials and goto subdomain.somesite.com/. In fiddler, the result is to goto root of subdomain.somesite.com, so that is working. The next question would be how to record in JMeter the request 'subdomain.somesite.com/users/sign_in/service:accounts?redirect=/' Is it an http Request that I track, is it broken up and the path added in the path field, how is the ':' handled... thanks for insight .
When you record it, JMeter will automatically capture all the redirect pages and sub domains. Most likely the redirect will be an HTTP Request to "/users/sign_in/service:accounts" with parameter for redirect with value
Performance testing is an important process of any software development. Even though these are not common interview questions for Java developers, you can bring it up yourself to many open-ended questions. Setting up a performance/load test script is always the first step in fixing non-functional and hard to reproduce issues relating to memory leaks, database deadlocks, thread-safety,  CPU usage, excessive disk I/O, etc. 

Q. How did you go about fixing a performance issue?
A. Set up
 JMeter to reproduce the production like scenario to put through concurrent requests and put the system under heavy load. Used a profiling tool to monitor CPU times, memory usage, etc.

Q.
 What are some of your recent accomplishments?
A.  Reduced the response time from 4 seconds to 2 seconds. Set up
 JMeter to put the system under peak load. Used a profiling tool to monitor CPU times, memory usage, etc. Identified the bottle neck, and improved the situation by fixing the offending database connection leak, back tracking regular expression, and a badly constructed SQL query with Cartesian joins. 

Q.
 How would you go about writing a JMeter based performance test case for the following scenario?

·                     XML/HTTP based RESTful Web Service calls are made against an order execution system. The system should be able to handle a basic load of 30 orders per 3 min. There will be 30 concurrent users. This means 600 orders per minute.
·                     The test case should simulate at least 2 different account ids.
·                     30 orders per 3 min x 60 minutes = 600 orders per hour.

A.
 The JMeter version 2.4 is used for the following screenshots. The number of artefacts shown for this are as shown below.

STEP 1: Relevant files.


·                     OrderExecution.jmx is the JMeter script.
·                     1-OrderRequest.xml and 2-OrderRequest.xml are the two sample XML payloads that will be sent via an HTTP POST (RESTful Web service).
·                     TestData.csv is a data file used for retrieving values 1 & 2 to switch between 1-OrderRequest.xml and 2-OrderRequest.xml to simulate 2 different accounts.

1-OrderRequest.xml

1
2
3
4
5
6
<?xml version="1.0" encoding="UTF-8"?>
<OrderRequest>
    <accountId>12345</accountId>
    <quantity>150</quantity>
    <unitPrice>12.50</unitPrice>
</OrderRequest>

2-OrderRequest.xml
1
2
3
4
5
6
<?xml version="1.0" encoding="UTF-8"?>
<OrderRequest>
    <accountId>6789</accountId>
    <quantity>200</quantity>
    <unitPrice>6.50</unitPrice>
</OrderRequest>

TestData.csv
1
2
1
2
STEP 2: JMeter scripts

If you open the OrderExecution.jmx script file, you will see something like this.
 

Lets' go through each of the elements.
 Thread Groups are equivalent of virtual users in other performance testing system. You can add this element by right clicking on the test plan and then selecting Add --> Threads (Users) --> Thread Group. As per the requirements, the system should handle 30 concurrent users. The ramp up time is 180 seconds, which is 3 minutes. All 30 threads will get started in 3 minutes. The loop count is set to 20, to produce 600 orders (i.e. 30 threads * 20 loops) . 
It is a good practice to define some variables as shown below, so that these variables can be used in downstream elements without having to hard code. If you want to run against a different host, you can just change it in spot as opposed to having to change it in a number of places. You can add this by right clicking on "Order Processing" and then selecting Add --> Config Element --> User Defined Variables.
The CSV Data Config is a very useful element to read test data from CSV file and then save the read values into some variable. In this example, the values 1 and 2 are read from the file TestData.csv, and stored in a variable named "account". The one iteration will set account to 1, and the next iteration will set it to 2, and then the same assigment repeats since "recycle on EOF" is set to true.


The HTTP Header manager sets the HTTP headers. In this example, the content type is set to application/xml because we are posting the XML files 1-OrderRequest.xml & 2-OrderRequest.xml 
The HTTP request defaults sets the default values so that you don't have to repeat it in each request. Also, note that the user defined variables in the first step are used within ${} as opposed to literal values. 

The loop controller can be added to loop through the samplers a number of times. In this example, it is set to 1. 
The samplers can be added by right clicking on the "Create Order" loop controller and then selecting Add --> Sampler --> HTTP Request. It shows the path, method, and the file to send. The actual RESTFul web service call will have the URL
1
http://localhost:8080/myapp/executionservices/execution/1.0/order/create
Also, note that in the File Path the ${DATA_PATH} is a user defined value, and ${account} is a variable that is assigned from the TestData.csv file via the CSV Data Config element. The account will be dynamically changed between 1 and 2 to retrieve the files 1-OrderRequest.xml and 2-OrderRequest.xml respectively for each iteration. 

JMeter supports a number of samplers like SOAP request, FTP request, JDBC request, JMS publisher, JMS subscriber, etc to name a few. 
The
 XPath assertions are used to assert the response for presence of responseCode="SUCCESS" and a valid orderId > 0. The response message will look like
1
2
3
4
5
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OrderResponse>
   <orderId>50045671</orderId>
   <responseCode>SUCCESS</responseCode>
</OrderResponse>
The other three elements are reporting elements. There are many reporting elements to choose from depending on the requirements. You can add reporting elements via Add --> Listener.
Finally the Gaussian Timer that will delay the execution by 3 minutes (i.e. 180000 ms) with a standard deviation of 10 seconds. This will ensure the throuput of 30 orders per 3 minutes. 
Q. How would you go about automatically recording the your browser actions into JMeter?
A.
 This can be achieved 2 ways.
Use
 BadBoy, which is a tool to record your Web interactions.The  recorded script can be exported as a JMeter file with the extension .jmx to be imported into JMeter. The generated script will not be pretty, but it can be cleaned up and further extended within JMeter with user defined variables,  CSV data config, HTTP defaults, etc. You can record the script as you use your application.

    
·                     Use JMeter as an HTTP proxy server to record your browser actions.Firstly, set up your JMeter to act as a proxy server on an available port like say 9090 as shown below.
  Configure the proxy server as shown below:
·                     Port: 9090
·                     Target Controller indicates where to record. In the above diagram indicates to capture it in the WorkBench under the proxy server itself. This allows you to later on move the captured elements one by one into the TestPlan. 
·                      You don't want to capture everything. So, filter it with include and exclude patterns. For example,  Include: .*myapp.*, Exclude: .*\.jpg. 
·                     "Start" the proxy server.
You need to set up your browser to use this proxy server.
Finally, start using the browser to record your actions. For example, you could use the following URL
http://myhost:7001/myapp/home
 
Note: If you use
 localhost instead of myapp as the host, JMeter may not record your actions. To overcome this, type ipconfig on your DOS prompt and copy the local IP address and use that instead of localhost in your URL.
Q.
 What are Pre-Processor and Post-Processor elements?  In what order does JMeter process various type of elements?
A. A
 Pre-Processor executes some action prior to a Sampler Request being made. If a Pre-Processor is attached to a Sampler element, then it will execute just prior to that sampler element running. A Pre-Processor is most often used to modify the settings of a Sample Request just before it runs, or to update variables that aren't extracted from response text.
A
 Post-Processor executes some action after a Sampler Request has been made. If a Post-Processor is attached to a Sampler element, then it will execute just after that sampler element runs. A Post-Processor is most often used to process the response data, often to extract values from it.
A
 Regular Expression Extractor can be used as a Post-Processor element to extract values to be used elsewhere in subsequent requests. For example, if you are using JSF and Seam frameworks, the jsfViewState and CID values can be extracted as shown below:
The elements are executed in the following order as per the JMeter documentation.
0. Configuration elements
1. Pre-Processors
2. Timers
3. Sampler
4. Post-Processors (unless SampleResult is null)
 
5. Assertions (unless SampleResult is null)
 
6. Listeners (unless SampleResult is null)
Timers, Assertions, Pre- and Post-Processors are only processed if there is a sampler to which they apply. Logic Controllers and Samplers are processed in the order in which they appear in the tree. Other test elements are processed according to the scope in which they are found, and the type of test element.
 
Q.
 What are some of the challenges you faced with JMeter?
A.
If a subsequent request rely on the cookie set by the previous request, the "cookie manager" element is required.
 When setting up the "CSV Data Set Config", don't have any spaces in the variable names.
Q. Have you used any features of JMeter that gave you greater flexibility?
A.
 Yes. The JMeter supports BeanShell scripting for greater flexibility. The BeanShell is a small, free, embeddable Java source interpreter with object scripting language features, written in Java. 
If you want to output all the order ids extracted out of the response messages for the response messages shown below
1
2
3
4
<OrderResponse>
<orderId>50013914</orderId>
<responseCode>SUCCESS</responseCode>
</OrderResponse>
?
1
  
An XPath Extractor can be used to extract the "orderId" from the response message and store it in a variable named "orderId" as shown below.

Now, the
 BeanShell PostProcessor can use the extracted "orderId" variable and write to a file (e.g. C:\\Temp\\order-processing\id.txt ) as shown below.

You could do a lot more powerful things by writing your own embedded scripting with the BeanShell. For example, You can create your own file named MyBeanShell.bshr and copy it to $JMETER_HOME\bin folder. The MyBeanShell.bshr will have functions like
 
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
getReportStartDate()
{

 import java.text.SimpleDateFormat;

 cal = Calendar.getInstance();
 cal.add(Calendar.DATE, -10);
 sdf = new SimpleDateFormat("dd-MMMM-yyyy");
 return sdf.format(cal.getTime());
  }
 isTenth(int loopCounter)
{
  returnValue = false;
 if (loopCounter % 10 == 0)
 {
 returnValue = true;
 }
 return returnValue;
}
You could invoke these functions from your JMeter elements like
${__BeanShell(return getReportStrtDate();)}
Also, note that pre-defined functions like  __time can be used  as shown above. There are also handy JMeter plugins from Google code at http://code.google.com/p/jmeter-plugins/ containing useful functions, listeners, samplers, etc. Just download the zip file and extract the "JMeterPlugins.jar" into $JMETER_HOME\lib\ext folder. This plugin features are prefixed with jp@gc.
Finally, instead of BeanShell or simple functions out of the box like __time, you could also write your own Java based custom functions using theorg.apache.jmeter.functions.Function
 interface by writing your function  as described here http://gabenell.blogspot.com/2010/01/custom-functions-for-jmeter.html.
Q.
 How do you ensure re-usability  in your JMeter scripts?
A.
 
Using config elements like "CSV Data Set Config", "User Defined Variables", etc for greater data reuse.
·                     Modularizing shared tasks and invoking them via a "Module Controller".
·                     Writing your own BeanShell functions, and reusing them.
Posted by The BASS at 5:10 AM No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: Jmeter, Performance Testing Software /Tools
Older Posts Home
Subscribe to: Posts (Atom)

Search This Blog

About Me

The BASS
View my complete profile

My Other Blogs

  • Sara Health Care
  • Wiki World Info
  • Amway India

Labels

  • A - Dictionary (3)
  • Agile Methodology (2)
  • Ant (1)
  • API Automation (1)
  • Automation (4)
  • Automation Tools (1)
  • Browser Compatibility Tools (1)
  • Bugzilla (1)
  • C - Dictionary (15)
  • Certifications (1)
  • CMMi (9)
  • Continuous Integration (CI) (3)
  • Defect Tracking Tools (1)
  • Flash Automation Tools (1)
  • Interview (1)
  • Jmeter (3)
  • Mobile Automation ( iOS / Android) (8)
  • Mobile Testing (4)
  • P - Dictionary (1)
  • Penetration Testing & Tools (2)
  • Performance Testing (8)
  • Performance Testing Software /Tools (9)
  • Performance Tetsing (1)
  • Project Management (PM) (6)
  • Project Management Tools (1)
  • Q - Dictionary (1)
  • Quality Management / Standards / Methodologies (13)
  • Robotium (1)
  • S - Dictionary (1)
  • SAT - Selenium Ant TestNG Framework (1)
  • security testing (6)
  • SecurityTesting Tools (2)
  • selenium (1)
  • Selenium - Auto IT (1)
  • Selenium + JUnit + Jmeter (1)
  • Selenium Automation Frameworks (7)
  • Selenium IDE (12)
  • Selenium IDE + Flex plugins (1)
  • Selenium RC (1)
  • Selenium RC + PHPUnit (1)
  • Selenium RC + PHPUnit + Ant (1)
  • selenium sites (2)
  • Software Process Improvements (SPI) (6)
  • SQA (1)
  • System/Server Side Testing and Tools (2)
  • T - Dictionary (2)
  • Test Management Tools (2)
  • Testing - Study Materials (5)
  • Testing Articles (2)
  • Testing Forums (2)
  • Testing Tools (1)
  • Unit Testing - Skills/Tools/Tips (3)
  • W - Dictionary (1)
  • Web Service/API Testing - Skills/Tools/Tips (3)
  • Web Testing - Skills/Tools/Tips (2)
  • Website Cookie Testing (1)

Blog Archive

  • ▼  2017 (1)
    • ▼  February (1)
      • SecurityTesting Tools
  • ►  2016 (2)
    • ►  January (2)
  • ►  2015 (13)
    • ►  March (1)
    • ►  February (6)
    • ►  January (6)
  • ►  2014 (35)
    • ►  December (9)
    • ►  November (19)
    • ►  August (1)
    • ►  June (1)
    • ►  May (5)
  • ►  2013 (11)
    • ►  October (2)
    • ►  July (1)
    • ►  March (6)
    • ►  January (2)
  • ►  2012 (17)
    • ►  October (2)
    • ►  August (4)
    • ►  March (1)
    • ►  February (10)
  • ►  2011 (52)
    • ►  December (1)
    • ►  October (6)
    • ►  September (3)
    • ►  August (12)
    • ►  July (11)
    • ►  June (14)
    • ►  May (3)
    • ►  March (2)

Sara's Software Testing and Quality Assurance Site

Loading...

Followers

Total Pageviews

Simple theme. Powered by Blogger.