Alexey Doborovich is a QA Engineer at BlazeMeter. He specializes in manual testing of the GUI Functional Tests.

Learn JMeter in 5 Hours

Start Learning
Slack

Test Your Website Performance NOW!

arrow Please enter a URL with http(s)
Sep 24 2019

How to perform a local GUI Functional test through Taurus

GUI Functional Testing is the compliance check of the application’s UI and it’s functionality to the requirements.

 

GUI Functional Tests could be launched in different ways and through different applications. One of the most simple ways to run a GUI Functional Test is to run it directly from the Blazemeter application.

 

Another option is to run test through the Taurus application. It allows you to launch tests faster and check your test’s statistics in real time through the console window.

 

What is Taurus?

 

Taurus is an open source automation framework for running various open source load testing tools and functional testing tools. Taurus supports Apache JMeter, the most popular open source load testing tool, Selenium, Gatling, The Grinder, and others.

 

Some key advantages of using Taurus with JMeter instead of directly using the JMeter scripts are:

  • It is easy to maintain and manage the Taurus scripts by using source control management tools such as GitHub.
  • Taurus provides you the ability to execute existing JMeter (or Grinder or Gatling or Selenium) tests.
  • It provides you the ability to merge multiple existing JMeter test scripts and/or DSL-driven tests into a single scenario.
  • The Taurus source code is easily understandable and readable.
  • It is easy to execute Taurus from Continuous Integration tools such as Jenkins.
  • It is easy to describe the test case scenarios in the YAML or JSON format without any knowledge of the JMeter GUI.
  • Taurus works easily on all the operating systems. It is easy to run existing JMeter scripts from the Taurus using the command-line options.
  • It is easy to use different available options for running JMeter tests, setting, and overriding certain test parameters of a JMeter test from a YAML configuration file, and using several YAML files to build a unified single test.

 

To perform a GUI Functional Test locally through Taurus you need to first create your YAML file as described in this article.

 

After you’ve created your YAML file, open the console window and call bzt command with the filename if you are in the directory with YAML file, or insert link to a file (e.g.):

bzt firstTest.yaml

bzt ~/Desktop/tests/firstTest.yaml  

local GUI Test in Taurus

But before you call the bzt command let’s examine your YAML file configuration which is needed to start the test with Taurus. Here is the example of the script you can use:

 

modules:
  selenium:
    remote: https://{apiKey}:{apiSecret}@a.blazemeter.com/api/v4/grid/wd/hub
    capabilities:
      blazemeter.testName: {testName}
      blazemeter.projectId: {projectId}
      blazemeter.buildId: {buildId}
      blazemeter.locationId: harbor-{id}
      
execution:
- executor: selenium
  scenario: 2608-Selenium
  iterations: 1
  capabilities: 
    browserName: chrome
    
- executor: selenium
  scenario: 2608-Selenium
  iterations: 1
  capabilities: 
    browserName: firefox
   
scenarios:
  2608-Selenium:
    generate-flow-markers: true 
    headless: false
    timeout: 60s
    think-time: 0s
    requests:
    - label: Test
      actions:
      - go(http://blazedemo.com/)
    - label: select From
      actions:
      - selectByName(fromPort): "Portland"
      - clickByName(fromPort)
    - label: select To
      actions:
      - selectByName(toPort): "Dublin"
      - clickByName(toPort)
    - label: click Find
      actions:
      - clickByCSS(input.btn.btn-primary)
    - label: click Choose
      actions:
      - clickByXPath((//input[@value='Choose This Flight'])[3])
    - label: enter Name
      actions:
      - clickByID(inputName)
      - typeByID(inputName): "John"
    - label: enter City
      actions:
      - clickByID(city)
      - typeByID(city): "Madrid"
    - label: click Purchase
      actions:
      - clickByCSS(input.btn.btn-primary)

 

Let’s consider specific blocks of the script, analyze configuration parameters and their assignment:

 

{testName} parameter is used to set the title of the test. You can add it at your discretion.

 

Taurus GUI Functional Testing

 

If you don’t add {testName} in the configuration - default value will be used (see screenshot).

 

local GUI Functional Test with Taurus

 

{projectId} parameter is used to set specific project in which you want to launch the test. Id of each project you can find in the url when specific project is selected in the Projects dropdown.

Eg. https://a.blazemeter.com/app/#/accounts/{id}/workspaces/{id}/projects/{id}/tests When {projectId} is set to default number or isn’t set at all - test will be performed in the Default project:

 

Taurus test functional

 

When specific {projectId} is set in the config - specific project will be used to launch the test:

 

GUI Functional tests with Taurus

 

{buildId} parameter is tied to reports view and executors number. If you add more than one executor (see example below) in the script and want to include them into one report - you should add {buildId}. This value should be unique and can be added at your discretion.

 

[Executor] section example:

 

- executor: selenium

scenario: 160901-Selenium

blazegrid: true

iterations: 1

capabilities:

browserName: chrome

 

After your script is executed - you’ll receive one report with a certain number of sessions (executors).

 

Taurus local test

 

GUI Functional testing with Taurus

 

In the case when {buildId} isn’t added each executor will be performed as separate report:

 

Taurus open source testing

 

Harbor-{id} parameter is created to indicate in which location test should be launched.

You can get Harbor-{id} value using API request:

https://a.blazemeter.com/api/v4/grid/locations

 

Taurus GUI Functional Testing

Taurus test

 

If you don’t add harbor-{id} in the configuration - the default value will be used (see screenshot).

Taurus test

 

Please note that remote data contains the API key Id and API secret Id. These parameters are needed to launch the test for specific user.

You can generate them with the help of the following article: https://guide.blazemeter.com/hc/en-us/articles/115002213289-BlazeMeter-API-keys-

Example:

https://{apiKeyId}:{apiSecretId}@a.blazemeter.com/api/v4/grid/wd/hub

 

Now you can call bzt command in your console to start a GUI Functional test with Taurus: After that Taurus will be launched in the console.

 

GUI Taurus test

 

You can verify the progress of the test in the console window.

 

Taurus functional test

 

The new active report will be displayed in the reports list here.

Taurus reporting

 

The report’s data is available for you to see when your test is finished:

 

Taurus GUI test

 

You can verify if there are any errors that occurred during the test, and statistics for each step. Also in the directory with your YAML script file new folder will be created with the following list of files:

Taurus local GUI test

 

Running this test in BlazeMeter

 

You can launch the same test from Blazemeter GUI Functional Tests tab. The full process of starting the GUI Functional Test is described here: https://www.blazemeter.com/blog/getting-started-with-GUI-functional-testing-with-blazemeter.

 

Use the following YAML script to perform the test:

 

# Script generated by Blazemeter Chrome Extension

modules:
  nose:
    ignore-unknown-actions: true

execution:
- executor: selenium
  scenario: 2608-Selenium
  iterations: 1
  capabilities: 
    browserName: chrome
    
- executor: selenium
  scenario: 2608-Selenium
  iterations: 1
  capabilities: 
    browserName: firefox
   
scenarios:
  2608-Selenium:
    generate-flow-markers: true 
    headless: false
    timeout: 60s
    think-time: 0s
    requests:
    - label: Test
      actions:
      - go(http://blazedemo.com/)
    - label: select From
      actions:
      - selectByName(fromPort): "Portland"
      - clickByName(fromPort)
    - label: select To
      actions:
      - selectByName(toPort): "Dublin"
      - clickByName(toPort)
    - label: click Find
      actions:
      - clickByCSS(input.btn.btn-primary)
    - label: click Choose
      actions:
      - clickByXPath((//input[@value='Choose This Flight'])[3])
    - label: enter Name
      actions:
      - clickByID(inputName)
      - typeByID(inputName): "John"
    - label: enter City
      actions:
      - clickByID(city)
      - typeByID(city): "Madrid"
    - label: click Purchase
      actions:
      - clickByCSS(input.btn.btn-primary)

 

 

You can run GUI Functional Tests, Performance Tests and more with the open source tools of your choice with BlazeMeter’s Continuous Testing Platform. Get started here for free.

     
arrow Please enter a URL with http(s)

Interested in writing for our Blog?Send us a pitch!