Which custom groovy code written in upload programatically summary report to MySQL data base in jmeter - mysql

I want the results to be uploaded after the test, how to configure summary report listener in csv file, after the test completion upload MySQL db, what custom code is used uploading programmatically

When you run JMeter in command-line non-GUI mode like
jmeter -n -t testplan.jmx -l result.jtl
you're getting .jtl results file
In order to get the "Summary Report" from the .jtl results file you can use JMeter Plugin Command Line Tool like:
JMeterPluginsCMD.bat --generate-csv summary.csv --input-jtl result.jtl --plugin-type SynthesisReport
At this stage it will be more convenient to use MySQL LOAD DATA statement like it's described in Import CSV File Into MySQL Table
If you still want to use Groovy - take a look at Creating/Inserting data chapter of Working with a relational database page of Groovy documentation

Related

Is it possible to generate a junit.xml test report file with Insomnia CLI just like Newman does?

When using Postman, you can specify tests for each of the requests in your collection, then, when executing the collection in a CI/CD environment through Newman, you can specify a command line like this:
newman run my-collection.json -r cli,junit --reporter-junit-export junit.xml
This will generate a file named junit.xml containing the results for each test in your collection.
How can the same be achieved using Insomnia's CLI Inso?

I want to save a CSV with Aggregate Report in JMeter. I need to save this file in my local repository where the JMX file is

I want to save a CSV with Aggregate Report in JMeter. I need to save this file in my local repository where the JMX file is. How I can indicate the path? Please help.
You can generate the CSV file with Aggregate Report data out of the .jtl file containing your test results using JMeter Plugins Command Line Graph Plotting Tool
Install JMeter Plugins Command Line Tool using JMeter Plugins Manager
you may also need to install Synthesis Report if you don't have it
Run your JMeter test in command-line non-GUI mode like:
jmeter -n -t test.jmx -l result.jtl
Once your test is complete you can generate Aggregate Report CSV representation as follows:
JMeterPluginsCMD --generate-csv aggregate-report.csv --input-jtl result.jtl --plugin-type AggregateReport
this aggregate-report.csv is a relative path to the current folder, you can make it absolute like:
JMeterPluginsCMD --generate-csv c:/somefolder/someotherfolder/aggregate-report.csv --input-jtl result.jtl --plugin-type AggregateReport
More information: How to Use the JMeterPluginsCMD Command Line

How to get throughput and response time in Jmeter in Non GUI mode

Actually I don't want to generate HTML file, it is unable to parse for rsp and tsp. I am using Jmeter on server and using from non GUI mode. I normally come across to run many different threads with more than 1 sampler requests. So , I need to get the response time and throughput for those threads on a quick and easy basis.
JTL result and csv file is giving rsp only. I need perfect solution which provides my solution.
even if there is a way to generate a csv file containing results of RSP and TSP which I need, will be fine for me.
** also I cant load the jtl file on jmeter on my system to check results manually.
Any suggestions are welcome.
The easiest option would be going for JMeterPluginsCMD Command Line Tool which can generate a CSV form of the Aggregate Report listener out of the .jtl results file, you will need to execute a command like:
JMeterPluginsCMD.bat --generate-csv report.csv --input-jtl result.jtl --plugin-type AggregateReport
Just replace result.jtl with your .jtl results file name and the tool will create the Aggregate Report for you,
You can install this JMeterPluginsCMD Command Line Tool along with
Synthesis Report using JMeter Plugins Manager
Steps to Generate CSV including Throughput and Responsetime
-1- Need to install JMeter Plugin Manager - Download the jar file "jmeter-plugins-manager-1.1.jar" - Place it in lib/ext
-2- Install command-line graph plotting tool using JMeter Plugin Manager option in "Options"
-3- Install jpgc-synthesis for AggregateReport using JMeter Plugin Mangager
-4- And use the following command
java -jar C:\Performance\apache-jmeter-3.3\lib\cmdrunner-2.2.jar --tool Reporter --generate-csv test.csv --input-jtl testJmeter3.jtl --plugin-type SynthesisReport

Executing binary SQL file using SQLCMD from WiX

I'm trying to install SQL script(SSDT) using SQLCMD - as this script contains to many SSDT definitions and cannot be run by the WIX SQL extension.
i want my SQL script file to be binary(as i don't want it to stay on target machine)
how can i set the SQLCMD command to use the binary script (with -i)?
p.s.
i tried this blog:
http://neilsleightholm.blogspot.co.il/2008/08/executing-sqlcmd-from-wix.html##
but this code don't shows the link between the binary SQL file and the SCLCMD command.
can someone help me with the correct code?
this is the code i used, which did not work for me
<Binary Id="CreateSchema.sql" SourceFile="..\SQL\CreateSchema.sql" />
<CustomAction Id="sqlcmd.cmd"
Property="sqlcmd"
Value=""sqlcmd.exe" -S [DATABASE_SERVER]
-i "[#CreateSchema.sql]" -v var=SYSTEM_USER -o [INSTALLDIR]installSql.log" />
<CustomAction Id="sqlcmd"
BinaryKey="WixCA"
DllEntry="CAQuietExec"
Return="check"
Execute="deferred"
Impersonate="yes" />
<InstallExecuteSequence>
<Custom Action="sqlcmd.cmd" After="InstallFiles">NOT Installed</Custom>
<Custom Action="sqlcmd" After="sqlcmd.cmd">NOT Installed</Custom>
</InstallExecuteSequence>
the log file showed that -i parameter did not had any file name value:
MSI (s) (4C:6C) [09:58:15:610]: Executing op: CustomActionSchedule(Action=sqlcmd,ActionType=1025,Source=BinaryData,Target=CAQuietExec,CustomActionData="sqlcmd.exe" -S (local) -i "" -v var=SYSTEM_USER -o C:\installSql.log)
That's not how <Binary> works. The [#FileID] syntax is used to dynamically use the at runtime installation full path of a component's file.
Binaries are used typically as temporary extracted files for custom actions or, in this case, sql files among other things.
Consider looking into the SQL Extension in wix. As a minimal example take a look at this code.
Add the sql namespace xmlns:sql="http://schemas.microsoft.com/wix/SqlExtension"
<Binary Id="CreateSchema" SourceFile="..\SQL\CreateSchema.sql" />
<sql:SqlDatabase Id="MyDB" Database="[DATABASE]" Server="[DATABASE_SERVER]" />
And in a component you can add
<sql:SqlScript Id="CreateSchemaScript" BinaryKey="CreateSchema" ExecuteOnInstall="yes" Sequence="1" SqlDb="MyDB"/>
Here is a link to the SQL Schema definition with all the available elements. I haven't done much with the SQL Extension so you may need to do some reading to get a better idea of what you will need to do to accomplish creating your DB on install.
As i mentioned i wanted to use both SQLCMD - since my SQL script is SSDT format, and binary file(so file will be deleted in end of the install).
After looking for answers i understood that i cannot use the WiX [#filekey], as binary file will not be extracted as long as there is no custom action that is running - using it explicitly.
So in the end i understood that the best way is to extract the binary file by my self.
the steps i used in one single custom action are:
extract binary SQL script from MSI binary table.
save this file locally
run SQLCMD with -i and new file path(the one i save to)
delete the SQL file
I encounter some issues, worth mentioned, if you save the file to INSTALLDIR than the directory may not exist at the tun time of the custom action, so consider save it to temp folder or to create directory beforehand.

How can jenkins find junit.xml in a zip file?

I am running Jenkins on a script, that generates a junit.xml report file and other files. However, all those files are zipped by the script, hence Jenkins cannot find it.
Is there a way to make Jenkins unzip the .zip file , find my particular junit file and generate the run results ?
All this is in Linux.
Thanks
Jenkins has the ability to execute arbitrary shell commands as a build step, just add the 'Execute Shell' step to your build and put in the commands you want (presumably 'unzip' would be among them).
Once you've extracted the xml, provided your internal tool generates it using this schema the JUnit plugin just needs the path you extracted to and it will show the results on the build page.
If you have the option, I would really suggest executing your tests via gradle or maven, as outputs from those tasks will produce a report that Jenkins (and other tools) can already read, and can streamline the job setup process for your users. But, if you can't get away with that, the above should work for you.