Skip to main content

Posts

Showing posts with the label JMETER

Capture Multiple Screenshots in Selenium WebDriver

If you have an automated test case which involves testing of continuous application flow, there is always a chance that you want to capture series of screenshots. If you have ever encountered such need and have wondered how it’s done, look no further than MultiScreenShot. A nice little utility to capture multiple screenshots. Not only this. It also lets you take screenshot of individual element and minimize the browser. In this post, we will see how we can setup this utility with Selenium WebDriver and use it to capture multiple screenshots. We have taken a simple example of About Google page to explain this process. Let’s get into action. Follow below steps to setup and use MultiScreenShot. Download MultiScreenShot JAR file from  here . Associate the downloaded JAR file in your Selenium WebDriver project by adding it into Java Build Path. Import below package in your class file. 1 import multiScreenShot . MultiScreenShot ; To use MultiScreenShot, you need...

SSO with SAML login scenario in JMeter

SAML(Security Assertion Markup Language) is increasingly being used to perform single sign-on(SSO) operations. As WikiPedia puts it, SAML is an XML-based open standard data format for exchanging authentication and authorization data between parties, in particular, between an identity provider and a service provider. With the rise in use of SAML in web applications, we may need to handle this in JMeter. This step-by-step tutorial shows SAML JMeter scenario to perform login operation. First request from JMeter is a GET request to fetch Login page. We need to fetch two values ‘SAMLRequest’ and ‘RelayState’ from the Login page response data. We can do this by using  Regular Expression Extractor . These two values need to be sent in POST request to service provider. Refer below image to see how to do this. We will get an HTML login page as a response to the request sent in 1st step. We need to fetch values of some hidden elements to pass it in the next request. We...

JMeter CSS/JQuery Extractor Example

Since version 2.9, JMeter has provided an option to extract value using CSS/JQuery Extractor post-processor. This is quite useful as now it would be possible to get the value of elements using CSS and JQuery expressions. In this article, we will explore how JMeter CSS/JQuery Extractor post-processor can be used to fetch values from web page response. Google home page is taken as reference for this example. We have recorded a step which will fetch Google home page as response. We will try to extract value of search field’s ‘autocomplete’ parameter using CSS/JQuery Extractor. Follow below steps to perform this task. Add CSS/JQuery Extractor post-processor under the recorded Google home page’s request. Add Debug Sampler and View Result Tree listener under thread group. Your script should look as below after performing these 2 steps. Run the script for getting response of Google home page. For Google search field, JMeter receives below code in View Result Tree listener’s resp...

Tips to Counter JMeter Out of Memory Error

Often while running load test with too many users, JMeter may experience out of memory error. Reasons for this error could be many. And troubleshooting the error takes a significant amount of time. Therefore to help you in debugging JMeter out of memory error, here we have listed down some possible culprits and some solutions to counter them. Let’s check out each of them in detail. Heap memory:  JMeter may require more Heap memory than the allocated. It is set to 512 MB by default. You can increase that limit to allow more Heap memory to JMeter. For this, edit your jmeter.bat file in any editor and change values of “ set HEAP=-Xms512m -Xmx512m”  parameter. GUI mode:  If you are not debugging your JMeter script, it is advisable to run it in Non-GUI mode.  Click here  to know more about it. Running JMeter in Non-GUI mode ensures less resource consumption. Listeners:  Disable listeners such as Graph Result, View Result Tre...

JMeter Exceeded Maximum Number of Redirects Error Solution

While running performance test, JMeter allows maximum 5 redirects by default. However, if your system demands more than 5 redirects, it may result in JMeter exceeded maximum number of redirects error. In this post, we have listed down steps to overcome this error. Actual error in JMeter: Response code: “Non HTTP response code: java.io.IOException” Response message: “Non HTTP response message: Exceeded maximum number of redirects: 5” This error is noticed because  JMeter  allows maximum 5 redirects by default and your system may be using more than 5 redirects. You need to increase this count to more than 5 in jmeter.properties file. Follow below steps to achieve this. Navigate to /bin directory of your JMeter installation. Locate jmeter.properties file and open it in any editor. Search for “httpsampler.max_redirects” property in opened file. Uncomment the above property by removing # before it. Change to value to more than 5 Eg. 20. Save the file and restart JMet...

Difference Between Redirect Automatically and Follow Redirects in JMeter

In this post, we will highlight important difference between Redirect Automatically and Follow Redirects options. These options are found in HTTP Request sampler of JMeter. Knowing the difference will help you decide your performance test strategy. When you check Redirect Automatically option, JMeter will not consider redirect as separate HTTP request. This in turn may result as lower response time in your overall performance test. Whereas Follow Redirect option will consider each redirection as separate requests. This may result in comparatively higher response time. This only has any effect if “Redirect Automatically” is not enabled. To see the difference between these two, record a sample script and run it by checking Redirect Automatically and Follow Redirects option. The second option will generate more requests in your result listener. As you can see from the above post, knowing the difference between Redirect Automatically and Follow Redirects option makes difference i...

JMeter Target Server Failed to Respond Error Troubleshooting

Since JMeter version 2.10, there is an increased occurrence of NoHttpResponseException error. Due to this error, JMeter sometimes returns the dreaded ‘Target Server Failed to Respond’ message. In this tutorial we will list out some simple steps to troubleshoot JMeter Target Server Failed to Respond error. Let’s have a look at what may be causing this issue. As per  JMeter Wiki : The increase of this type of errors can be explained by two settings changes: retry of failing request (idempotent ones only) has been disabled in JMeter 2.10 stale check in HTTP Client 3 and 4 implementations has been disabled in JMeter 2.11 Below are some simple steps you can take to prevent this error from happening. Enabling Retry:  Navigate to JMeter installation’s bin directory. Edit jmeter.properties file. Uncomment httpclient4.retrycount property by removing # sign before it and set its value to 1. Apply the same changes to httpclient3.retrycount property as well. Depending on y...

Introduction to JMeter Templates

For starters, JMeter may not appear much user-friendly due to many of its features and complexity. To help ease this problem, JMeter has introduced Templates feature in version 2.10. This post gives a short introduction to  JMeter Templates  feature. It also explores how it can be useful to new users and experienced users alike. Basically JMeter Templates are skeleton scripts that you can reuse to get started with a project. You can also merge code snippets in your current test plan using this feature. Below are the templates available by default in JMeter. Recording JDBC Load Test BeanShell Sampler MongoDB Load Test Building a Web Test Plan Building an Advanced Web Test Plan Building a SOAP Web Service Test Plan Building an FTP Test Plan Building an LDAP Test Plan Building an extended LDAP Test Plan As you can see there are number of default templates provided in JMeter. New users will be able to leverage these default templates to get started without diggin...