Robot Framework HTML Report Customisation - robotframework

I need to customize the HTML report generated at the end of test execution.
Few things I require are:
Remove the table - Statistics by Tags as I am not using any tags
Add the version number for the SUT in the summary section of the report.
What solutions are there for this? I tried to change the robot code and also tried to work on the output.xml. But nothing worked.

There is no facility provided by robot to customize the report and log files, as far as adding or removing sections is concerned. You have two options:
write your own report generator that converts output.xml into a format you like, or
create a fork of the robot framework source code and make the modifications there.
For the case of putting the version number for the SUT in the summary section of the report, you can add that with the --metadata command line option:
pybot --meta "SUT version: 1.2.3" ...
That will add the version to the summary section. You can also use the Documentation setting or the --doc command line option to put information that will appear in the report summary.
If you aren't using tags, you should! Those are one of the best features of the framework. You can create tags during a test run, so you could have your tests define a "sut version" tag and set it to the version of the system being tested.

Related

display options for subcommands using PicoCLI

I am using PicoCLI v4.0.0-beta-1b. I am using different subcommands linked from a parent command. The parent command's optional parameters get displayed when I launch the CLI but not for the subcommands. The subcommands only appears underneath commands (but with no options).
How does one go about to ensure that the options for subcommands appear in the CLI as well?
Options:
-a, --autocomplete Generate sample autocomplete
-h, --help Display this help message.
-v, --verbose Verbose mode. Helpful for troubleshooting.
-V, --version Show version info and exit.
Commands:
abc
def
By default, picocli only shows an overview of a command's subcommands, and no details. This follows the conventions of other command suites like git. The idea is that end users can always get details for another subcommand by asking for help for that specific subcommand, like git commit --help, or git help commit.
While this is a useful default, if that's not what you want, picocli usage help is highly customizable.
The picocli usage message has the following sections:
header heading
header
synopsis heading
synopsis
description heading
description
positional parameter list heading
positional parameter list
option list heading
option list
command list heading
command list
exit code list heading (since 4.0)
exit code list (since 4.0)
footer heading
footer
Each section has its own IHelpSectionRenderer, and you can change the usage help by removing, reordering or replacing these help section renderers.
An example to get you started is here:
https://github.com/remkop/picocli/blob/master/picocli-examples/src/main/java/picocli/examples/customhelp/ShowAll.java
The above example has a custom IHelpSectionRenderer for the command list, to show the full hierarchy of commands, subcommands, and sub-subcommands, etc. You may want to do something similar but show the options of the subcommands instead.
You will need to familiarize yourself with some details of the picocli Help API, like TextTable, Layout, IOptionRenderer, etc.

Customize IBM DiffMerge to export a custom Report

I am using IBM DiffMerge to generate a Report that shows all differences between two .cls files or .sbs files. I was playing with it and I saw that there is a filed in option menu that allows you to change the format of the report, but it implies some keywords, like $elemname to print the element's name or $elemtype to print its type $leftonly or $rightonly which show how many differences are in the left diagram or in the right one.
Now, I was wondering if there are more variables like those above, especially one that can print a component's GUID (unique ID in Rhapsody).
Thanks,
Daniel
I would expect that $GUID will give you what you're looking for.
Under the ReporterPlus installation folder there is a folder named Templates. In it you'll find a file named DiffReport.dpl which you can load it into ReporterPlus for editing like any other template. You must run Rep+ with a command line option so that it loads with the Diffmerge specific schema:
Reporter.exe /mode=dfm
After that you can load the Diffmerge template, and edit it to customize the output of DiffMerge reports. When you do, try adding $GUID into the output.
Regards, Simon

How to change reports or output saving location in robot framework from RIDE

When I run test cases from RIDE the reports are saved in the below path.
C:\Windows\Temp\RIDExf4xla.d
I want save reports in specific path. Can I do this from RIDE? Is there any setting to change the reports location?
Can anyone please suggest the way to do it.
Thanks
Look at the --outputdir command within the Robot Framework Documentation:
Here is what I use:
--outputdir C:/Robot/AutomationLogs/etc/etc --timestampoutputs
You use this one liner on the "Arguments" Field, right on the top of RIDE within the run tab.
From Wamans comment you can add formats to the end of the argument, to also change the dir name dynamically. See the 2nd answer within that SO question. This should be enough for you to get what you're asking for.
There is no way to set this within a UI.
Just set it by pasting that argument option within the "Arguments" Field at the top.
use below code in command line
C:\Tests\> robot -d C:\Test_results Test.robot

Trying to understand how TestNG concatenates method name + description to display on report

Trying to understand how TestNG concatenates method name + group name + description to display on report. I have a test suite which only shows the method name on my TestNG report but then I have other test suites that are concatenating the test description after the method name and displaying that entire string on the report (under the 2nd column after the class name column). I can't figure out what controls this difference.
Does anyone understand how this works and is enabled/disabled in the suite? In this scenario, TestNG is being executed by the Maven Surefire plugin, which as you know, places the emailable report under the "target" directory rather than under "testng-output".
Also, an additional detail I am wondering about is: can the description be altered during the Test method so that the altered description can be shown on the report?
This screenshot shows the favorable display of group and description but I have many other test suites that do not show this information and I want to know how to enable it.
Not sure about the report generated by SureFire, but if you use TestNG without Maven it generates two reports - emailable-report, index. Both display the same data but in different presentation. And we can customize the report content by creating a listener and overriding the default methods.
Refer this post on how to customize the report.
To your first question, it seems old versions of testng (prior to 6.8.1) used to have emailablereporter as its default reporter. Later versions have emailablereporter2 as it's default which doesn't show description. Try specifying listener as below to see descriptions against methods.
<listener class-name="org.testng.reporters.EmailableReporter"></listener>
The description can be altered by implementing IAnnotationTransformer.

How I can include the use of the extension deck.automation.js when I create a document Rmarkdown-slidify-deck.js in RStudio?

How I can include the use of the extension deck.automation.js when I create a document Rmarkdown-slidify-deck.js in RStudio? It is to show a presentation on a screen with statistical content without interaction from anyone, and when finished will start automatically.
https://github.com/rchampourlier/deck.automatic.js
http://ramnathv.github.io/slidify/index.html
Here is a demo of how to add this extension to deckjs, while using Slidify. In short, here is what you need to do.
Use author("mydeck") to initialize deck, change framework to deckjs and run slidify("index.Rmd")
Download the extension automatic and add it to libraries/frameworks/deckjs/extensions.
Modify libraries/frameworks/deckjs/config.yml so that automatic is added to the list of extensions.
Modify libraries/frameworks/deckjs/partials/snippet.html, so that the javascript snippet required to initialize the extension is added.
You can also add an option for Play/Pause, as well as set custom slide durations. Instructions are in the slide deck here.
UPDATE: The instructions here assume that you have the dev branches of Slidify and Slidifylibraries installed.
pkgs <- c("slidify", "slidifyLibraries")
devtools::install_github(pkgs, "ramnathv", ref = "dev")

Resources