Getting jmeter aggregate report information into variables - testing

I am using jmeter to run a series of tests against a web application, mostly web services hosted from Jboss and soon to be Tomcat.
Most of the tests I do run autonomously and I typically write results to a reporting database.
I am trying to find a way to get the information that is displayed in the aggregate report (average, median, max etc..) assigned to variables.
If I can get these values into variables I can then write them to my reporting database and/or perform calculations with them.
The aggregate report is giving me exactly the information that I want, but I don't want to have to manually move the data to a reporting system if I can get away with it.

The easiest way is configure Aggregate Report to write the output to file. After test completion you should be able to load data to database as follows (MS SQL Example)
USE your_schema;
GO
BULK INSERT dbo.your_schema
FROM 'path_to_your_csv_results_file'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
If you want more flexibility I would suggest using JSR223 Post Processor and Groovy as language to fetch previous sampler details.
There is a pre-defined variable called prev which stands for SampleResult class - see linked JavaDoc on available methods. You can extract required values and store them to JMeter Variables like:
vars.put("StartTime", String.valueOf(prev.getStartTime()));
and then process variables as you wish.
The reason of choosing JSR223 instead of Javascript, BSF, Beanshell, whatever is that JSr223 Sampler in case of Groovy language and compilation caching enabled which gives performance almost equal to native Java code.
JMeter JSR223 recommendation explanation
Comparison Benchmark of JMeter Scripting engines

Related

Is it possible to automate comparisons between database results with groovy script?

I am in the process of migrating an application which currently performs all of its SQL calls internally (as part of the code) to Restful services so that the SQL calls are handled externally. I am in need of a smart way to test that these changes have no effect on the actual data that is retrieved from the database.
I was thinking it might be possible to write some automation tests against the APIs and then use groovy script to compare the results of both.
Using Soap UI
1: old SQL call - returns XML
2: New Restful call -returns JSON
3: Compare both results.
The issue I have is that a direct call returns XML whereas the new call returns JSON.
I just need to know if this is a waste of time or if this is worth pursuing?
The only other option I can think of currently is to manually run two tests on both versions at the same time and observe any differences if they occur.
Thanks for taking the time to read.
If you need any more detail please let me know but tried to keep it brief!

How to create a Logic/Script for a Data Extension?

I always implement scripts into a Cloudpage or directly into a newsletter but I never created a script which will run by her own in a special interval. Would that be possible? Maybe every night?
There is a script activity that is available that allows you to do that. However, it's for Server-Side JavaScript opposed to AMPscript. Once you save the script in the script activity you can then add it to an automation just like any other activity and execute it at the required intervals.
The feature isn't typically on by default so you will likely need to request it to be enabled by support. You should then see it listed as an option with the other activities.

How to find all places where variable is used in JMeter scenario?

I use JMeter to record HTTP scenario and do load testing. Now I need to correlate some values using Regular Expression Extractor, for example ${secure_id}, but I don't know how to find all requests where this variable is used. I can substitute this step by step, but it is necessary for me to do it automatically in all places where it is used. Thanks for any answer
You could open your TestPlan.jmx file with text editor notepad++ for example and find+replace all occurrences of ${secure_id} here is an example
Have you seen "Search" option in JMeter's main menu? It's available since JMeter 2.9 if not earlier
As #Boyan suggests JMeter scripts are XML files so you can use your favourite text editor for bulk replacing hardcoded recorded value with the variable
You can use a 3rd-party recorder which has SmartJMX mode. The main feature is automatic correlation of any detected entities. See How to Cut Your JMeter Scripting Time by 80% for details.

How to pass random parameters to SilkTest Workbench or Classic Record&Play Scenario

I am new to SilkTest and I don't have any scripting background. What I need to do is to record some test cases and then play them to check my system. After getting used to it, I plan to learn scripting and dive into it, but first things first.
What I need is to pass random generated (or randomly read from a text file or pre-defined) parameters into the recordins so that every time I run the tests, different parameters are used. For example, there is a component in which I write some letters and the component filters the results based on the text. Then, I select one of the results. Now, instead of recording the same letters everytime, how can I use random given parameters?
Thanks
What you are looking for is called Active Data in Silk Test.
It allows enhancing your visual tests with external data, for example from an Excel file.
ActiveData testing enables you to leverage existing data in external files as input for powerful, comprehensive application testing solutions. ActiveData testing enables you to perform multiple transactions against test applications using a different set of data for each transaction without writing complicated code or compromising existing data.
You can find an introduction to Active Data in the online documentation or in the tutorial video.
I have a question, what version of Silk Test are you using, also, what client are you using (Silk Test Workbench, Silk4Net or Silk4J). Each of these clients has the ability to receive parameters from an external source whether it is from a command line or from an external data file.
You indicate that you want random data, do you really mean random data or external data? If it is random data that you want you probably need to use a random number/string generator for the client that you are working with (.Net code for Workbench and Silk4Net and Java code for Silk4J).

A process monitor based on periodic sql selects - does this exist or do I need to build it?

I need a simple tool to visualize the status of a series of processes (ETL processes, but that shouldn't matter). This process monitor need to be customizable with color coding for different status codes. The plan is to place the monitor on a big screen in the office making any faults instantly visible to everyone.
Today I can check the status of these processes by running an sql statement against the underlying tables in our oracle database. The output of these queries are the abovementioned status codes for each process. I'm imagining using these sql statements, run periodically (say, every minute or so), as an input to this monitor.
I've considered writing a simple web interface for doing this, but I'm thinking something like this should exist out there already. Anyone have any suggestions?
If just displaying on one workstation another option is SQL Developer Custom Reports. You would still have to fire up SQL Developer and start the report, but the custom reports have a setting so they can be refreshed at a specified interval (5-120 seconds). Depending on the 'richness' of the output you want you can either:
Create a simple Table report (style = Table)
Paste in one of the queries you already use as a starting point.
Create a PL/SQL Block that outputs HTML via DBMS_OUTPUT.PUT_LINE statements (Style = plsql-dbms_output)
Get creative as you like with formatting, colors, etc using HTML tags in the output. I have used this to create bar graphs to show progress of v$Long_Operations. A full description and screen shots are available here Creating a User Defined HTML Report
in SQL Developer.
If you just want to get some output moving you can forego SQL Developer, schedule a process to use your PL/SQL block to write HTML output to a file, and use a browser to display your generated output on your big screen. Alternately make the file available via a web server so others in your office can bring it up. Periodically regnerate the file and make sure to add a refresh meta tag to the page so browsers will periodically reload.
Oracle Application Express is probably the best tool for this.
I would say roll your own dashboard. Depends on your skillset, but I'd do a basic web app in Java (spring or some mvc framework, I'm not a web developer but I know enough to create a basic functional dashboard). Since you already know the SQL needed, it shouldn't be difficult to put together and you can modify as needed in future. Just keep it simple I would say (don't need a middleware or single sign-on or fancy views/charts).