2013-01-30

What is HTTP Header Manager? Why we use it

In this following article we are going to see what is HTTP Header Manager in JMeter and why we use it.

By naming, we can understand it is one king of element that controls the header. And, it will be present in side a config element(as it holds all type of configurable elements)

So, When ever we add a HTTP Header Manager(Thread group->(right click)add->Config Element)->HTTP Header Manager). We can see a section "Headers Stored in the Header Manager". This section contains all header. We can either add or load(previously saved) a header list.
So, When we add a header we have provide type of http header as name and the string of the header as value.
Ex- If we want to add a opera User-Agent in header, we will add a blank row, we will write "User-Agent" in the name section and value "Opera/12.80 (Windows NT 5.1; U; en) Presto/2.10.289 Version/12.02"

Note: When we add headers in the manager, those headers are append to the request. For a whole thread group, one header manager should be present(multiple supported). If one header added to multiple manager , latest one(or specific one) will be use.

Some useful headers are
-Accept  
-Accept-Charset  
-Accept-Encoding  
-Accept-Language  
-Accept-Datetime     
-Cache-Control  
-Connection  
-Cookie    [preciously set cookie, (different from cookie manager)]
-Content-Length  
-Content-Type  
-Date  
-Expect  
-Host        
-Pragma  
-Proxy-Authorization  
-Range  
-Referer     
-Upgrade  
-User-Agent  
-Via  
-Warning



We can see the full list in this here.

Why we use HTTP Header Manager? When we need to send http request with specific header( that may define the http response because of that header). For example,
-when we need specify user agent/browsers
-When we need to specify language
-When we need to specify Date/Time
-When we need to specify Date
-When we need to specify Content Length/type
-When we need to specify conditions of response to server
-When we need to specify proxy

... Thanks..:)

2013-01-29

JMeter Load Testing with Cassandra/MySql/Derby/SQLite/Ingres/PostgreSQL/Oracle/MS Access

In this article we are going to see how can we perform DB testing for other DB than MS SQL.


We can find driver class and DB url patterns from my previous post.
The common steps we can find from my post here. We have to change the driver , and the class/db url from that post only.
So, the drivers(.jar file) for different DBs are located in following links.
For Oracle: Driver link is here
For MySQL: Driver link is here
For PostgreSQL: Driver link is here
For Ingres (2006): Driver link is here(parent link here)
For Apache Derby: Driver link is here(extract one release and get derbyclient.jar from lib)
For SQL Server (Sourgeforge Driver): Driver link is here
For Cassandra : Driver link is here
For SQLite: Driver link is here or (this or this )
For Microsoft Access(ODBC bridged) : No Need to Download Driver (for more idea, see this)
For Microsoft Access(StelsMDB) : Driver link is here

I have tested on mysql, sql server(2005, 2008, sqlexpress)

Note : All DB list here . When we need to test any specific one, wither we have find the driver or we may have to write the driver in JAVA.

Thanks..:)

2013-01-28

Driver classes & Database URLs for JDBC Drivers

In this article we will see different Driver class & Database URL pattern(syntax) used with JDBC driver in JAVA. We will use them with JMeter under JDBC Connection Configuration config element.
See my SQL testing post for know more about SQL testing.

Database Name : MySQL
Driver class: com.mysql.jdbc.Driver
Database URL :jdbc:mysql://host[:port]/dbname

Database Name : PostgreSQL
Driver class: org.postgresql.Driver
Database URL : jdbc:postgresql:{dbname}

Database Name : Oracle
Driver class: oracle.jdbc.OracleDriver
Database URL : jdbc:oracle:thin:@//host:port/service
OR
jdbc:oracle:thin:@(description=(address=(host={mc-name})(protocol=tcp)(port={port-no}))(connect_data=(sid={sid})))

Database Name : Ingres (2006)
Driver class: ingres.jdbc.IngresDriver
Database URL : jdbc:ingres://host:port/db[;attr=value]

Database Name : Apache Derby
Driver class: org.apache.derby.jdbc.ClientDriver
Database URL : jdbc:derby://server[:port]/databaseName[;URLAttributes=value[;...]]

Database Name : SQL Server (MS JDBC driver)
Driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver
Database URL : jdbc:sqlserver://host:port;DatabaseName=[dbname]
OR 
 jdbc:sqlserver://host:port;instanceName=[sqlexpress];DatabaseName=[dbname]


Database Name : SQL Server (Sourgeforge Driver)
Driver class: net.sourceforge.jtds.jdbc.Driver
Database URL : jdbc:jtds:sqlserver:// [server name or ip] / [db name]

Database Name : MS Acces [ODBC bridged]
Driver class: sun.jdbc.odbc.JdbcOdbcDriver
Database URL : jdbc:odbc:dsn", "", ""

Database Name : MS Acces( StelsMDB)
Driver class: jstels.jdbc.mdb.MDBDriver2
Database URL : jdbc:jstels:mdb:
For more idea, see this

Database Name : cassandra-jdbc
Driver class:org.apache.cassandra.cql.jdbc.CassandraDriver
Database URL : jdbc:cassandra://host:port/dbName;

Database Name : SqlLite
Driver class: org.sqlite.JDBC
Database URL : jdbc:sqlite:sample.db


This is all from the jmeter doc. I mention separately to help other in finding them. 
I will try to increase more driver syntax incrementally.

Thanks ...:)