xBot 2.0 Beta Files to download:

What is the xBot?

xBot is an application which allows a user to run (or initiate a run by scheduling) automated test scripts on a remote machine from the PractiTest UI.

xBot agent diagram

The Process

  1. Install and execute the xBot agent on the remote machine
  2. Create Tests of Automation type “xBot” in your PractiTest project and update them with the relevant script details
  3. Create Test Sets for the xBot Tests and run them either immediately or later by scheduling them

Setting up the xBot agent

  1. Download the xBot agent executable for your platform: Windows, Linux or Mac (OS supported at the moment) to a folder on the machine where you plan to run the automated script. The files to download are available at the top of this page
  2. Open a console, navigate to the folder where you downloaded the xBot agent executable
  3. Obtain a PractiTest API token (You can find the instructions here)
  4. Run the xBot agent from the console (you will need to specify 3 parameters when you run the agent for the first time)
    Following is a Windows example: xbot-agent-win.exe --backend-url="wss://xbot-backend-prod.practitest.com" --api-token="YOUR_API_TOKEN" --client-type="CLIENT_TYPE"
    • backend-url - For the US datacenter: "wss://xbot-backend-prod.practitest.com"
      For the EU datacenter: "wss://eu1-xbot-backend-prod.practitest.app"
    • api-token - The API token you obtained from the account (instructions above)
    • client-type - A string you will specify when you create the xBot tests in PractiTest, normally used to make sure tests for different platforms will be run by the appropriate agent
  • After the first run of the xBot via the console the .config file will be created in the xBot agent's folder and you will be able to run the agent without specifying the parameters again
  • If you need to change a parameter, just specify it once xbot-agent-win.exe --client-type="SOME_OTHER_CLIENT_TYPE"
  • If you don't want to change anything, you can run the agent without any parameters: xbot-agent-win.exe

Creating xBot Tests

  1. Go to the Test Library, and click on "New Test"
  2. Choose “Automated Test” as Test Type, then select “xBot” from the dropdown menu xBot test in Test Library
  3. In the “Automation Info” section, you can find the xBot parameters that needs to be defined: xBot automation info tab
    • Script Path: Fill the exact, or relative (using parameters) path of the script on your machine. The path should be from the xBot client machine to the automated test itself (for example a path to a script written in Selenium). Make sure all machines can access this address.
    • Client type: Fill the name of your agent as defined when you ran the xBot Agent for the first time via the console. This is a unique id of the xBot client machine that should run the test, as defined in the configuration of the xBot.
    • Results Path: Fill the exact path from the xBot client machine to the automated test result file(s) location. It can be the path to a single file or to a directory. At the end of the script execution, the XBot will upload files from this path to the PractiTest server and attach them to the Test’s run.
    • Number of result files to upload: Fill the number of files you’d like to be uploaded from the above location to PractiTest. If you fill a number smaller than the actual number of results you will get, xBot will upload the first 3 in the alphabetical order.
  4. Click on “Save Changes”

Defining the Test results for your scripts

The xBot will send report to the PractiTest server the results of your automated tests based on the following convention:

  • A Passed Test should result with 0 (zero).
  • A Failed Test is everything but 0.

In addition the xBot will send the results file(s) to PractiTest server

  • Each of the uploaded files will be saved as an attachment of the automation run.
  • The xBot will upload the latest defined number of files in the specified directory, or a specific file.

Running xBot Tests:

  • Create a new Test Set and add xBot Test/s to it: Adding xBot tests to test sets
  • Click on “Run now” to run all of the Tests one by one, or you can click on each “Run” button in Test Instances Grid to execute them separately: running xbot tests
  • While the test is running, you can follow up with the CPU and memory capacity during its execution on the machine where the xBot is currently running. On the right hand side of the window you can see the xBot Status that indicates whether your browser is connected to xBot backend and showing you real time data. At the bottom of the screen you can find other tests pending in queue: xBot run details
  • After refreshing the Run page, you will see: xBot run results
    • Updated Run Status (Passed, Failed, or Error)
    • Execution output, as per script
    • Uploaded Result files:

Scheduling the Test Run:

  1. Go to the Test Set containing xBot Test Instances window, you will see the additional “Run Later” button.
  2. Press the button and schedule the Run of the Test Set with a simple date/time panel: Scheduling xBot Runs

xBot tests view - Current & queue, scheduled and history:

Go to the Test Sets & Runs module, press Automation BETA tab and you will find 3 sub-tabs:
(Each of the tables can be refreshed by pressing the blue refresh button at the top right hand side of the table)

Current & Queue

In this table you will see the queue of running/pending xBot tests:

xBot queue

In case your tests are pending and you cannot see another test running, there are probably xBot tests from different projects running on the same agents. This is how it will look:

xBot queue

Scheduled

In this tab you can view the scheduled test sets for xBot2 BETA.

Scheduled test sets xBot

Under 'actions' you can choose to move a test to the queue now (meaning to run it now). The system will ask you if you wish to run it and keep the scheduled test set, or to run now and remove it from the scheduled table.

Move scheduled to queue

History

In this tab you can view the history of xBot2 BETA test runs. Under 'actions' you can choose to re-run an old test.

History xBot