Rhino API - Language & Integration Extension
19/07/2021 - 45 minutes to read
Important
You can create a free Rhino Account on: https://g-api.azurewebsites.net/identity/account/register.
We support open source if you have an open source project, you can gain an unlimited FREE access to Rhino.
Please send your open source project URL to rhino.api@gmail.com and your Rhino user name to get a sponsored account.
In This Article
Advanced
Rhino as an open source W3C Web Driver based client (much like selenium) for executing various automation scenarios. Rhino is based on Gravity API Engine which manipulates Selenium, Appium and other automation technologies in order to execute unified, single interface abstract automation.
Rhino is a full W3C Web Driver compliant which means it can connect out of the box to any other Web Driver either locally, cloud or remote.
Commands
You can activate the command panel when pressing CTRL+SHIFT+P
keys combination. This will open the Command Palette from which you select and run extensions commands.
Once the Command Palette is open, type Rhino:
into the Command Palette text-box to filter out Rhino only commands.
Create-Project
The Create-Project
command opens the Select Folder
dialog, from which you can select the folder to create Rhino Project under.
Upon creating a project, the following folders and files will be created:
Configurations
a folder under which you can create configurations to run your tests with. Test can run on multiple configurations.
Models
a folder under which you can create page objects map for a quick access to UI elements or reuseable data.
Plugins
a folder under which you can create a resuable plugin for a quick access to common functionality.
TestCases
a folder under which you can create test cases for integration into ALM or for a direct execution.
manifest.json
, default project manifest.
Basics
Create New Project
When you first open Visual Studio Code, the start window appears, and from there, you can run the Create a new project
command.
- Launch VS Code.
- Open the Command Palette (
CTRL+SHIFT+P
).
- Type 'Rhino' to find the
Rhino: Creates a New Rhino Project
command.
- From the Select Folder dialog, select the folder where you want to place Rhino project.
- Click on Select Folder button.
Tip
You can create a new folder directly from the Select Folder dialog and select that new folder to host Rhino project files.
Rhino Project contains several default folders for the different Rhino components and a Manifest.json
file.
Manifest Overview
Every project has a JSON-formatted manifest file, named manifest.json
, that provides important information. The following code shows the supported manifest fields for Rhino Project.
Tip
A default manifest is created when you create a project.
{
"rhinoServer": {
"schema": "http",
"host": "localhost",
"port": "9000"
},
"connectorConfiguration": {
"collection": "<application url e.g. https://myjira.atlassian.net>",
"connector": "<connector type>",
"password": "<application password>",
"project": "<application project>",
"userName": "<application user name>"
},
"authentication": {
"username": "<rhino user>",
"password": "<rhino password>"
},
"driverParameters": [
{
"driver": "ChromeDriver",
"driverBinaries": "."
}
]
}
Field |
Type |
Description |
rhinoServer |
object |
The endpoint of Rhino server. This is the server where tests are sent when executing. |
connectorConfiguration |
object |
Provides the configuration for integrating Rhino with 3rd party project managements such as Jira or Azure. |
driverParameters |
array |
A collection of driver names their location. |
Create Your First Test Using Test Snippet
The easiest way to create a spec file, is to use the built in snippet. Please follow these steps to create your first spec file:
- Right click on
TestCases
folder.
- Select
New File
.
- Name your file
myFirstTestCase.rhino
.
- Open command palette by pressing
CRTL+SHIFT+P
.
- Type
Rhino
to find Rhino Commands.
- Select and run the command
Rhino: Connect to Rhino, fetch Metadata & activate commands
.
- If Rhino Server is up and running and accessible in the address provided in the project manifest.json, the following confirmation will be displayed.
- Start type
rhino
in the test file you have created on step no.#3, the rhinotest
snippet is now visible and can be selected.
- Once selected, a basic Rhino Spec will be generated and displayed.
- Use the
TAB
key to cycle the different argument and parameters in the spec.
- Save your file.
Run Your Test
Rhino can run the test spec directly from the VS Code document, by executing the invoke command. Please follow these steps to run your test:
- Open command palette by pressing
CRTL+SHIFT+P
.
- Type
Rhino
to find Rhino Commands.
- Select and run the command
Rhino: Runs the automation test(s) from the currently open document
.
- A progress indication will show in VS Code status bar.
- When test is complete, open your browser and navigate to http://localhost:9000/reports.
- Select your run from the runs list to see your run report.
See Also