Generate summary from robot framework log file - windows

we are using Jenkins for installation which is there from many years in our product.
But now I want to enhance it, we have some basic tests run for each component, each has its own robot log file placed in a folder.
I want a create a batch file using windows cmd to parse all log files in that folder, and get me the test cases which are failed.
Any idea how it can be done?
Thanks

I think, you requirement is rebot option of Robot Framework.
Consider, you have two test suites which are executed separately.
valid_login.txt
invalid_login.txt
Each test suite create three log files in Robot framework.
report.html
log.html
output.xml
First thing, you need to create the unique name for these all logs.
This can be done using :
-r for renaming report.html
-l for renaming log.html
-o for renaming output.xml
Example:
pybot -d "F:\robot framework\WebDemo\Logs" -o "invalid_login.xml" -l "invalid_login.html" -r "invalid_login_report.html" invalid_login.robot
In this way, after executing, you will have two set of reports.
Since you want to merge the reports and create the combined report, we will first create only XML log for each test suite.
pybot -d "F:\robot framework\WebDemo\Logs" -o "invalid_login.xml" -l None -r None invalid_login.robot
Above example will create only XML log file in given directory mentioned with -d option.
Once you execute above both test suites, it will create two XML log files.
invalid_login.xml
valid_login.xml
Now, you can merge the both XML and create combined report using below command.
F:\robot framework\WebDemo>rebot Logs\*.xml
Log: F:\robot framework\WebDemo\log.html
Report: F:\robot framework\WebDemo\report.html
F:\robot framework\WebDemo>invalid_login
rebot will take all XML files in Logs directory and create combined Log and Report file.
Check this link for more info !!!
Once you combined the all reports, you can filter the Failed test cases easily in report.html

Related

I need to deploy all the files in a diff file (txt) to an org Salesforce

I have to deploy from a git Diff to a Salesforce Org.
So I have all the files names written on a txt file and need to bring them all to the Salesforce Org.
The files I have them in local and need to, as I said, deploy them to the Salesforce Org.
I tried doing sfdx and writing them all but it gives me
"C:\Program" is not a reconized command
I tried adding """ at the start and """ at the end and separating each file with a "","" but it still doesn't work.
I know I can do it from a xml file but I have the diff in a txt.
The error sounds like your sfdx isn't installed correctly, you may have to reinstall. Or maybe you had newlines in your command and they messed something up?
You need to read up about force:source:deploy command, the -p parameter...
This is a decent example of what you can do. Bit boring, repetitive but deploys exactly these files and nothing more, not whole folders.
sfdx force:source:deploy -u prod -p "force-app/main/default/objects/MyObject__c/fields/Description__c.field-meta.xml,force-app/main/default/objects/MyObject__c/fields/Amount__c.field-meta.xml,force-app/main/default/objects/MyObject__c/fields/Quantity__c.field-meta.xml,force-app/main/default/classes/MyObjectTriggerHandler.cls" -l RunSpecifiedTests -r "SomeTestClass" --verbose --loglevel fatal
There are also some cool sfdx plugins that will generate the xml file for you based on difference between 2 commits? Search list at https://github.com/mshanemc/awesome-sfdx-plugins

Is it possible to generate jmeter html report using properties file as parameter using command line query

below is the command i used
jmeter.bat -n -t C:\Users\vingale\Desktop\Jmeter\apache-jmeter-5.0\Writeback\Iconductor_Writeback_With_Configurationbck_Property.jmx -l "C:\Users\vingale\Desktop\Jmeter\apache-jmeter-5.0\Writeback\output\result2.csv" -e -o "C:\Users\vingale\Desktop\Jmeter\apache-jmeter-5.0\Writeback\output\html" -p QA.properties
if i remove the properties file parameter then the html report get generated.
You're using -p command line argument which acts as the replacement for jmeter.properties file which contains Results file configuration which is necessary for proper dashboard generation.
If you have an extra file with properties used in your test you should use -q command-line argument instead of -p
More information:
Configuring JMeter
Overriding Properties Via The Command Line
Apache JMeter Properties Customization Guide
Going forward get used to look at jmeter.log file, in the majority of cases it should contain sufficient information in order to guess the root cause of the issue
JMeter uses reportgenerator.properties file for HTML report related configuration.
Official documentation recommends not to change the content in reportgenerator.properties file. It suggest user to copy the properties to be changed into user.property file and provide required values.
Following could be used to generate HTML report at the end of the testing
jmeter.bat -n -t C:\Users\vingale\Desktop\Jmeter\apache-jmeter-5.0\Writeback\Iconductor_Writeback_With_Configurationbck_Property.jmx -l "C:\Users\vingale\Desktop\Jmeter\apache-jmeter-5.0\Writeback\output\result2.csv" -e -o "C:\Users\vingale\Desktop\Jmeter\apache-jmeter-5.0\Writeback\output\html" -q user.properties
You will have to ensure the report output directory is empty.You will have to manually clear-out the directory or ask JMeter to delete the content forcefully with -f option
-f, --forceDeleteResultFile
force delete existing results files and web report folder if
present before starting the test

JMeter - override jtl file in non GUI with dashboard

When running non GUI with dashboard several times and have irrelevant results , I want to override sometimes the jtl file created using -l command:
jmeter ... -l result.jtl -e -o ...
But I keep getting error for file not empty:
Error in NonGUIDriver java.lang.IllegalArgumentException: Results result.jtl is not empty
How can I override in non GUI? I must delete manually the file before execution?
As per user manual, you can use:
-f
or
--forceDeleteResultFile
Which will force delete existing results files before start the test, which means only CSV is erased BUT not the report folder.
If you don't see this happening it's a bug which you seem to confirm:
https://bz.apache.org/bugzilla/show_bug.cgi?id=61956
But if you see the result file deleted but not the report folder then it's a regular expected result. If you think it's not good, maybe report an enhancement request.
As per Full list of command-line options JMeter User Manual chapter:
-f, --forceDeleteResultFile
force delete existing results files before start the test
So add -f argument to your command line and that would be it.
Also make sure you don't have any Listeners configured to save results into results.jtl file, the good practice is to disable any listeners during load test execution.
try:
jmeter ... -f -l result.jtl -e -o ...
The -f, force delete existing results files before start the test. This also include the log files.
example:
sh /usr/local/Cellar/jmeter/5.5/bin/jmeter -n -t ../Load-Test.jmx **-f** -e -o ../report -l ../log/Pref

How to clean up the resulted csv file and html file in nonGUI mode using Jmeter command

I have created a testsuite in JMETER and running through nonGUI mode and capturing the results in csv file and using same csv file data and generating a dashboard report.
Since i wanted to do continuous integration, need to clean up the result files each time and regenerate fresh result data files.
You can execute JMeter with -f option which delete existing results files:
-f, --forceDeleteResultFile
force delete existing results files before start the test
See full options list.

How to generate and view dashboard generated reports in jmeter?

In windows, using the command "jmeter -n -t [test JMX file] -l [test log file] -e -o " to generate the dashboard result doesn't execute and shows the error.
You have at least 2 problems:
first ensure that you have a Java 7 or 8 installed and that this command works:
java -version
second, change your current directory to be in the jmeter_home\bin folder (C:\Users\Freeware Sys\Documents\apache-jmeter-3.0\bin) ad run command from there
Please follow below steps to generate report dashboard instead of using jmeter.log file.
Add Simple Data Writer from Listeners.
Provide your path, where you want to generate like it could be in csv file or xls file etc.
Note: Remember one thing you should not create a file whether it could be csv,xls etc file because Simple Data writer automatically creates the Test results file as provided location.Then simple run your test plan and try to generate report dashboard with command prompt with generated Test Result file. You can read more configurations here.
Here it has given complete step by step details for generating Report Dashboard in Jmeter.

Resources