Hajar Hajar
  • Home
  • Services
    • Online Training
    • Classroom Training
    • Corporate Training
  • Jmeter Tutorials
    • Chapter 1
    • Chapter 2
    • Chapter 3
    • Chapter 4
    • Chapter 5
    • Chapter 6
    • Chapter 7
    • Chapter 8
    • Chapter 9
    • Chapter 10
    • Chapter 11
  • Resource Library
    • Course Outline
    • Interview Questions
    • Download Apache Jmeter
    • Download Jmeter Plugins
  • Contact Us

READ MORE
SHARE :

Contact Us

Jmeter4u
BTM 2nd Stage,
Bangalore-560068

Contact Person: Atul
Contact Number: 7760527730

Email Id: jmeter4u@gmail.com
Skype Id: jmeter.experts

This is my place:
READ MORE
SHARE :

About Me


I am passionate and experienced Senior QA Engineer based in Bangalore, India with skill set in Manual Testing, Test Automation, and Performance Testing. I love to learn and experiment new trends and models in Software Testing. People hire me because i help them to get expertise in Jmeter.
Name: Atul Pant
Address: Bangalore, India
Education: B.Tech (Information Technology)
Experience: 5+ years as a Senior QA Engineer.
Certification: “CTFL” from ISTQB.
Domain: E-Commerce, SCM, CRM/SFA, POS and ERP.
Technologies: Java
Application: Client/Server and Web based Application Testing.
Database: MySQL, Mssql and Oracle.
READ MORE
SHARE :

Integrating selenium with jmeter for load testing

Approach 1:

 JMeter is an open source load testing tool, with many capabilities. One of the many interesting things which can be done is to integrate a WebDriver test into a JMeter test suite.
 JMeter can be used to record browser actions using proxy, but since JMeter doesn’t handle JavaScript, it cannot be used on its own to simulate realistic user interaction with a JavaScript/Ajax heavy web application.
 Selenium can be used to record user-interaction with a web application where lots of interactions happen using Ajax.
 It’s simple to integrate Selenium with JMeter.

Steps to Setup and configure Selenium WebDriver with Eclipse and Java:
1. Download and install Java.
2. Download and install Eclipse
3. Download WebDriver Jar Files.
4. Start Eclipse and configure it with selenium (WebDriver)
 a. Select Workspace on eclipse start up (Webdriverwork)
 b. Create new project ( File > New > Project > Java Project -> testproject)
 c. Create new package (mytestpackage)
 d. Create New Class (mytestclass)
 e. Add external jar file to java build path
  i. Right click on project 'testproject' > Select Properties > Select Java build path > Navigate to Libraries tab
  ii. Click on add external JARs button > select both .jar files from D:\selenium-2.46.0.
  iii. Click on add external JARs button > select all .jar files from D:\selenium-2.46.0\libs

That's all about configuration of WebDriver with eclipse. Now you are ready to write your test in eclipse and run it in WebDriver.

Code for Browser Mode

import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class mytestclass {
@Test
public void testing(){

WebDriver driver = new FirefoxDriver();
driver.get("http://www.jmeter4u.com/");
System.out.println(driver.getTitle());

}
}


Code for Headless Mode

import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;

public class Mytestclass {
@Test
public void testing(){

WebDriver driver = new HtmlUnitDriver();
driver.get("http://www.jmeter4u.com/");
System.out.println(driver.getTitle());

}
}

5. Run your script from eclipse “Run” menu.
6. Export resources into JAR file.
7. Click on File -> Export the export dialog will appear.
8. Choose Java- >Jar file -> click next

On Jmeter to run selenium test script:
1. Copy the junit test class jar file to lib/junit folder in JMeter installation folder.
2. Launch JMeter and create a Test Plan | Thread Group | Junit Request Sampler.
3. The Junit Request window should display the Junit Test Class (com.bs.webtest.Mytestclass) as well as the test method (testing) automatically picked up by JMeter.
4. Save the test plan.
5. Run test plan.

Finally, jmeter script looks like below one:


Approach 2:

 Web Driver Sampler automates the execution and collection of Performance metrics on the Browser (client-side).
 To use Selenium WebDriver with JMeter, simply install "WebDriver Set" plugins. The WebDriver sampler is super useful if you want to test for performance AJAX, GWT based web applications and simulated user actions.
 This adds to the overall perceived performance of website/webapp, but this metric is not available in JMeter.
 It is meant to compliment them by measuring the end user load time.

Steps to Setup for configuring WebDriver Plugin into Jmeter:
1. Download WebDriver plugins.
2. Unzip JMeterPlugins-WebDriver-1.2.1.zip
3. Unzipped files must be located in the lib/ folder.
4. Launch JMeter and create a Test Plan | Thread Group | Add "Config Element" -> "HTTP Cookie Manager" | Add "Config Element" -> "jp@gc - Firefox Driver Config" | Sampler -> "jp@gc - Web Driver Sampler" | "Listener" -> "View Results Tree".

Script for jp@gc - Web Driver Sampler
// Start capturing the sampler timing
WDS.sampleResult.sampleStart()

// Perform the Sampler task
WDS.browser.get("http://www.jmeter4u.com/");

// Verify the results
WDS.sampleResult.sampleEnd()

if(WDS.browser.getTitle() != 'Jmeter Training | Jmeter Experts | Jmeter Workshop | Jmeter Consultant') {
    WDS.sampleResult.setSuccessful(false)
    WDS.sampleResult.setResponseMessage('Expected title to be Jmeter Training | Jmeter Experts | Jmeter Workshop | Jmeter Consultant')

Finally, jmeter script looks like below one:


READ MORE
SHARE :

Jmeter Performance Testing

Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text. Here is the test text.

READ MORE
SHARE :

Server Monitoring Tools

Monitoring the server with a Custom JMeter plugin (PerfMon)

* JMeter Plugins at Google Code (JP@GC) is a popular third-party plugins set for JMeter.
* The project provides additional samplers, graphs, listeners, and so on, all of which make it more fun to work with JMeter.
*Basically, the JP@GC set contains two types of plugins: graph plugins and JMeter functionality extensions.

The only prerequisite for installing it is that you are running JMeter 2.8 or later with JRE 1.6 (Java Runtime Environment) or above

Installation:

1. Go to the download section of http://jmeter-plugins.org/.
2. Download the JMeterPlugins-Standard-1.2.1.zip (JMeter custom plugins).
3. Download the ServerAgent-2.2.1.zip (Server resource monitoring agents).
4. Extract & paste the JMeterPlugins-Standard-1.2.1.zip file into lib/ext folder under JMeter installation path.
5. Extract & paste the contents of the ServerAgent-2.2.1.zip file somewhere on the server.
6. Launch the agent using startAgent.sh script on Unix, or startAgent.bat script on Windows and the agent will be started on port 4444.

Adding monitor listeners to the test plan

1. Launch JMeter.
2. Open the test plan
3. Add a PerfMon Metrics Collector listener by navigating to Test Plan | Add | Listener |jp@gc – PerfMon Metrics Collector
• Add one row each to gather these metrics (CPU, Memory, Network I/O, Disks I/O)
• Host/IP: localhost
• Port: 4444
• Metrics to collect (dropdown): CPU/Memory/Network I/O, Disks I/O
4. Add a response time vs threads listener by navigating to Test Plan | Add | Listener |jp@gc – Response Times over Time.
5. Add a Transactions per second listener by navigating to Test Plan | Add | Listener |jp@gc – Transactions per Second.
6. Save the test plan.

So, here is link to download it:

http://jmeter-plugins.org/
READ MORE
SHARE :

Download Apache Jmeter

Apache Jmeter is open source and can be downloaded from below link:

http://jmeter.apache.org/download_jmeter.cgi
READ MORE
SHARE :

Like Us

Drop Your LIne

Name

Email *

Message *

© 2015 Jmeter4u, All rights reserved

Template Created By : ThemeXpose . All Rights Reserved.