RB 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package RB --version 1.0.0                
NuGet\Install-Package RB -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RB" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RB --version 1.0.0                
#r "nuget: RB, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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

  1. Open Ranorex Studio
  2. Open your Ranorex Test Suite Solution
  3. Go to the project you want to install RB plugin in
  4. From menu, select Project > Manage packages .....
  5. On the right panel seach box, type in the word RB
  6. Look for a matching package on the left with text "Ranorex plugin for Bonsaih"
  7. Click on this and then click on Add button.
  8. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last updated
1.3.1 834 12/18/2018
1.3.0 641 12/15/2018
1.2.0 698 12/13/2018
1.1.0 1,137 11/29/2018
1.0.0 1,050 11/23/2018