Let's start for JMeter tutorial, how to connect database and all:
Start the jmeter from */*/bin/jmeter.bat. Where * indicate the your dir in windows.
A window will appear with title bar Apache jmeter.
Start the jmeter from */*/bin/jmeter.bat. Where * indicate the your dir in windows.
A window will appear with title bar Apache jmeter.
For accessing any database need to configure respective driver (lib ojdbc6.jar).
INFO - jmeter.engine.StandardJMeterEngine: Running the test!
INFO - jmeter.samplers.SampleEvent: List of sample_variables: []
WARN - jmeter.protocol.jdbc.config.DataSourceElement: Could not load driver: oracle.jdbc.OracleDriver java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
Simple need to place the jdbc jar file in jmeter lib dir. After that need to start again jmeter for further development, once you restart copy jar file will load in jmeter container and available for further use.
Now, create the JDBC Connection Configuration, for this need to Right Click on Test Plan >
Add > Config Element > JDBC Connection Configuration.
Note: This will be there for project or Thread group level.
Enter the data base details as mention in below image,
Name: JDBCConnectionConfiguration
Variable Name: nameofconnectionordatabase
Connection pool Configuration:
Max Number of Connections: 1 or n as per your db support.
In database connection configuration section:
Database URL: jdbc:oracle:thin:@//IPAddressofdatabase:port/sid
e.g: jdbc:oracle:thin:@//1.1.1.0:1234/nameofsid
JDBC Drive Class: oracle.jdbc.OracleDriver
User name and Password
For more details refer the http://jmeter.apache.org/
Right click on the My Thread Group > Sampler > JDBC Request
Enter the name of connect variable what we have added for JDBC Connection Configuration.
In Variable Name: nameofconnectionordatabase
Select the respective DML for me I selected the select statement.
Whatever query you have in query section.
e.g select * from dual;
Create the summary report > right click on the My Thread Group > Add > Listener > Summary Report.
Save it with your love name.
Click on the Test Plan and run it from tab button or from Run > Start.
You will able to see some result like above screen.
JDBCOracle.jxm file will same, We can use this file for running from Unxi system:
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.6" jmeter="2.11 r1554548">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="My Thread Group" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">1</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">1</stringProp>
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
<longProp name="ThreadGroup.start_time">1421937486000</longProp>
<longProp name="ThreadGroup.end_time">1421937486000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" testname="JDBC Request" enabled="true">
<stringProp name="dataSource">nameofconnectionordatabase</stringProp>
<stringProp name="query">select * from dual</stringProp>
<stringProp name="queryArguments"></stringProp>
<stringProp name="queryArgumentsTypes"></stringProp>
<stringProp name="queryTimeout"></stringProp>
<stringProp name="queryType">Select Statement</stringProp>
<stringProp name="resultVariable"></stringProp>
<stringProp name="variableNames"></stringProp>
</JDBCSampler>
<hashTree/>
<ResultCollector guiclass="SummaryReport" testclass="ResultCollector" testname="Summary Report" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
</hashTree>
<JDBCDataSource guiclass="TestBeanGUI" testclass="JDBCDataSource" testname="JDBCConnectionConfiguration" enabled="true">
<boolProp name="autocommit">true</boolProp>
<stringProp name="checkQuery">Select 1</stringProp>
<stringProp name="connectionAge">5000</stringProp>
<stringProp name="dataSource">nameofconnectionordatabase</stringProp>
<stringProp name="dbUrl">jdbc:oracle:thin:@//IPAddress:Port/SID</stringProp>
<stringProp name="driver">oracle.jdbc.OracleDriver</stringProp>
<boolProp name="keepAlive">true</boolProp>
<stringProp name="password">Password_schema</stringProp>
<stringProp name="poolMax">1</stringProp>
<stringProp name="timeout">10000</stringProp>
<stringProp name="transactionIsolation">DEFAULT</stringProp>
<stringProp name="trimInterval">60000</stringProp>
<stringProp name="username">User_Schema</stringProp>
</JDBCDataSource>
<hashTree/>
</hashTree>
</hashTree>
</jmeterTestPlan>
Learn from any stage any time, don't limit your self time to learn.
Thanks Ravindra for your kind response on Oracle DataBase Testing By Jmeter post.
ReplyDeleteWith this we can perform the load testing of database. Single script or groups...
good about database testing in jmeter, explain more about load testing...
ReplyDeletehi can u tell how can i pass the result of one sql query as an input to another sql query..?
ReplyDeletesuppose we get rollno as a result from 1st query so i will pass that rollno to another query to get the
address or any thing related to that student.
Just open the your test plan and click on the jmeter help you will get full details in JDBC Request where you can use in as mention below and you can use it as sql inside sql or nested sql.
DeletequeryArguments and type.
18.1.3 JDBC Request
This sampler lets you send an JDBC Request (an SQL query) to a database.
Before using this you need to set up a JDBC Connection Configuration Configuration element
If the Variable Names list is provided, then for each row returned by a Select statement, the variables are set up with the value of the corresponding column (if a variable name is provided), and the count of rows is also set up. For example, if the Select statement returns 2 rows of 3 columns, and the variable list is A,,C , then the following variables will be set up:
A_#=2 (number of rows)
A_1=column 1, row 1
A_2=column 1, row 2
C_#=2 (number of rows)
C_1=column 3, row 1
C_2=column 3, row 2
The process of working with JDBC Test Elements results is covered in depth in the Debugging JDBC Sampler Results in JMeter guide.
DeleteGood way to do your web site URL advertisement...
Deletehttp://www.tutorialbyexample.com/2015/02/oracle-database-testing-jmeter-tutorials.html
Just open the your test plan and click on the jmeter help you will get full details in JDBC Request where you can use in as mention below and you can use it as sql inside sql or nested sql.
ReplyDeletequeryArguments and type.
18.1.3 JDBC Request
This sampler lets you send an JDBC Request (an SQL query) to a database.
Before using this you need to set up a JDBC Connection Configuration Configuration element
If the Variable Names list is provided, then for each row returned by a Select statement, the variables are set up with the value of the corresponding column (if a variable name is provided), and the count of rows is also set up. For example, if the Select statement returns 2 rows of 3 columns, and the variable list is A,,C , then the following variables will be set up:
A_#=2 (number of rows)
A_1=column 1, row 1
A_2=column 1, row 2
C_#=2 (number of rows)
C_1=column 3, row 1
C_2=column 3, row 2
This comment has been removed by a blog administrator.
ReplyDeleteMervin, I will suggest don't do advertisement of you course and website if you have any concerns and daubt about my post feel free do let me know.....I'm seeing your people are putting comment for advertisement in my website. Hopping you people understood it. Let me know if you have question, jmeter tutorial or testing will more then happy to answer. But this is not at all write place to advertise your site, will charge going forward if you want to do it....and i found it.
DeleteDirectly hitting database table...and data for test... by soapui, how to know good performance or bad?
ReplyDeleteThanks for info, however you miss line mention above ...
DeleteConnection pool Configuration:
Max Number of Connections: 1 or n as per your db support.
In database connection configuration section:
Database URL: jdbc:oracle:thin:@//IPAddressofdatabase:port/sid
e.g: jdbc:oracle:thin:@//1.1.1.0:1234/nameofsid
JDBC Drive Class: oracle.jdbc.OracleDriver
User name and Password
and for performance you can see reports...
good example in jmeter for database testing..
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeletemay i know where can i get the ojdbc6 jar file?
ReplyDeleteYou can download ojdbc6.jar from http://www.java2s.com/Code/Jar/o/Downloadojdbc6jar.htm or or if you can do from oracle web site.
Deletehi,this is not related to db connections,Can i know the how we can take screenshots of failed test in jmeter
ReplyDeleteThanks for your question, you can use tool "ffmpeg" and pass the parameter for capturing the screen.
DeleteGood and nice blog post, thanks for sharing your information.. it is very useful to me.. keep rocks and updating.. Real User Monitoring
ReplyDeletethanks very much for your help
ReplyDeleteThank you a lot for providing individuals with a very
ReplyDeletespectacular possibility to read critical reviews from this site.
java training in chennai
java training in bangalore
This comment has been removed by a blog administrator.
ReplyDeletehttp://www.ciitnoida.com/ is worst institute, don't pay else they will still your money, and even though not provide training.
ReplyDeleteI think this is the best article today. Thanks for taking your own time to discuss this topic, I feel happy about that curiosity has increased to learn more about this topic. Keep sharing your information regularly for my future reference.
ReplyDeleteJava Courses in chennai
Very good post.
DeletePlease have look for AWS and DevOps Training online or corporate www.a2info.com.
Thank you for written this blog regarding to core technology.This is very Helpful and informative blog.
ReplyDeleteaws training in bangalore
java training in bangalore
Wonderful blog & good post.Its really helpful for me, awaiting for more new post. Keep Blogging!
ReplyDeleteWeb Design Training
You made me to feel fresh after reading your blog. Thanks for sharing.
ReplyDeleteSelenium training in chennai
Selenium training institute in Chennai
iOS Course Chennai
Digital Marketing Training in Chennai
Loadrunner training institute in Chennai
Qtp course in Chennai
I really love this blog thank you for sharing this useful information
ReplyDeleteselenium training centers in Marathahalli
best software testing training institutes in Marathahalli with placements
automation testing courses in Marathahalli
selenium testing course in Marathahalli
software testing institutes in Marathahalli
selenium training in Marathahalli
best selenium training in Marathahalli
selenium course in Marathahalli
nice blog
ReplyDeleteselenium training centers in Bangalore
best software testing training institutes in Bangalore with placements
automation testing courses in Bangalore
selenium testing course in Bangalore
software testing institutes in Bangalore
selenium training in Bangalore
best selenium training in Bangalore
selenium course in Bangalore
Nice Blog
ReplyDeleteselenium training centers in Bangalore
best software testing training institutes in Bangalore with placements
automation testing courses in Bangalore
selenium testing course in Bangalore
software testing institutes in Bangalore
selenium training in Bangalore
best selenium training in Bangalore
selenium course in Bangalore
Nice Blog..
ReplyDeleteselenium training centers in BTM
best software testing training institutes in BTM with placements
automation testing courses in BTM
selenium testing course in BTM
software testing institutes in btm
selenium training in btm
best selenium training in btm
selenium course in btm
This is done keeping in view the probability of anyone accessing the vital data on the database and tampering it. No unauthorized person can login to the database.dbdesigner.net
ReplyDeleteNice blog
ReplyDeleteangularjs training in Bangalore
angularjs training institutes in Bangalore
best angularjs training in Bangalore
This article is well written and quite informative.
ReplyDeleteMore articles should be written and you have just found a follower.and more visit.
mainframe training in hyderabad
Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information.
ReplyDeleteLoadrunner Training in Noida
In the event that you need an open-source and inserted database program for nearby/customer stockpiling in application programming,visit now you should utilize SQLite.
ReplyDeleteThere are extremely two essential types of disappointment in a hard drive, intelligent and physical. restore deleted data from hard disk
ReplyDeleteGreat post! I am actually getting ready to across this information, It’s very helpful for this blog. Also great with all of the valuable information you have Keep up the good work you are doing well.
ReplyDeleteCRS Info Solutions Salesforce Training
This comment has been removed by the author.
ReplyDeleteReally it was an awesome article, very interesting to read.
ReplyDeleteCRS info solutions is best Institute.
It's very useful article with informative and insightful content and i had good experience with this information. We, at the CRS info solutions ,help candidates in acquiring certificates, master interview questions, and prepare brilliant resumes.Go through some helpful and rich content Salesforce Admin syllabus from learn in real time team. This Salesforce Development syllabus is 100% practical and highly worth reading. Recently i have gone through Salesforce Development syllabus and Salesforce Admin syllabus which includes Salesforce training in USA so practically designed.
ReplyDeleteamazing article i have ever read in recent times. This is very inforamtive article.
ReplyDeleteI regularly visit this blog for this kind fo helpful posts. Thank you so much for this wonderful blog post,
keep posting such helpful information. I was looking fo.thank you for thizs article.
pega online training ,
best pega online training ,
top pega online training .
Thanks for sharing information to our knowledge, it helps me plenty keep sharing…
ReplyDeletebest apache spark online course
apache spark and scala online training