RB 1.0.0
See the version list below for details.
dotnet add package RB --version 1.0.0
NuGet\Install-Package RB -Version 1.0.0
<PackageReference Include="RB" Version="1.0.0" />
paket add RB --version 1.0.0
#r "nuget: RB, 1.0.0"
// Install RB as a Cake Addin #addin nuget:?package=RB&version=1.0.0 // Install RB as a Cake Tool #tool nuget:?package=RB&version=1.0.0
Overview
RB is a package for Ranorex which outputs test results in real-time and viewable using the Bonsaih real-time display. There are two use cases for RB plugin:
- As a log monitoring tool
- As a developer tool
RB plugin as a log monitoring tool
Installing the RB plugin
- Open Ranorex Studio
- Open your Ranorex Test Suite Solution
- Go to the project you want to install RB plugin in
- From menu, select Project > Manage packages .....
- On the right panel seach box, type in the word RB
- Look for a matching package on the left with text "Ranorex plugin for Bonsaih"
- Click on this and then click on Add button.
- Accept/decline the EULA
Note : Installing RB plugin will also download and install the 30-day trial version Bonsaih viewer as you need this tool to view the log.
Using the RB plugin
- Step 1: Add the following to Program.cs file
using RBplugin;
namespace RanorexTest
{
class Program
{
[STAThread]
public static int Main(string[] args)
{
Keyboard.AbortKey = System.Windows.Forms.Keys.Pause;
int error = 0;
try
{
//----------
RBLogger rbLog = new RBLogger(@"C:\Log\MyLog.txt",
true, false, false, false);
Report.AttachLogger(rbLog);
//----------
error = TestSuiteRunner.Run(typeof(Program),
Environment.CommandLine);
}
catch (Exception e)
{
Report.Error("Unexpected exception occurred: "
+ e.ToString());
error = -1;
}
return error;
}
}
}
Step 2: Recompile the solution
Step 3: Run your tests. It will now start outputting real-time logs to text file.
Viewing the output
The Bonsaih display should automatically launch showing the real-time log.
Configuring RB plugin
RB plugin does not have a config file. Instead you specify the configuration by setting RBLogger() input parameters.
- input 1: The output file. If the file or folder does not exist, they will be created. Screenshots are written to the same folder.
- input 2: Automatically launch Bonsaih (true/false).
- input 3: Take screenshots on Passed verifications
- input 4: Take screenshots on Warning
- input 5: Take screenshots on Error
Example:
RBLogger rbLog = new RBLogger(@"C:\Test\MyLog2.txt",
false, true, false, false);
Report.AttachLogger(rbLog);
RB plugin as a developer tool
Overview
RB plugin is a great developer tool because it lets you create structured output on the Bonsaih display that is easy to read when debugging your scripts. It lets you create tree structures, attach files and screenshots, color-code text and add QA icons. Bonsaih becomes your new Console window which updates in real-time, viewable remotely on another computer, contain screenshots and file attachments, etc.
Example
// Get an instance of the current file object
RBfile log = RBfile.Instance();
// Start writing debug log
// Note: these logs will be appear together with
// Ranorex generated logs on Bonsaih display
//
log.WriteLine("line 1");
log.Blue().WriteLine("line 2");
log.WriteLine("line 3");
log.Pass().Green().Screenshot().WriteLine("this step passed");
log.Red().Fail().Screenshot().WriteLine("this step failed");
log.Screenshot().Error().Pink().WriteLine("error icon displayed");
Viewing the output
The output is viewable on Bonsaih display. It is updated in real-time.
Available Commands
Pass() : Add a pass icon to the line.
Fail() : Add a fail icon to the line.
Warning() : Add a warning icon to the line.
Error() : Add an error icon to the line.
Blue() : Color the text blue.
Green() : Color the text green.
Red() : Color the text red.
Orange() : Color the text orange.
Pink() : Color the text pink/magenta.
RGB(int r, int g, int b) : Specify the RGB color for the line.
Indent() : Add indentation to the line on the right panel.
Unindent() : Undo an indentation.
Path(string branchPath) : Set the tree structure on the left.
New lines will be added to this path.
AddBranch() : Add a pass icon to the line.
RemoveLastBranch() : Add a pass icon to the line.
RemoveBranchesFrom() : Add a pass icon to the line.
Screenshot() : Take a screenshot of the desktop and attach
to the line.
File(string path) : Attach a file to the line.
WriteLine(string msg) : Write the BTML code and msg line to the file. The BMTL code
are specified by chaining the above functions. Nothing is written to the file
until this function is called.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.