T E S B O

Tesbo

Config File : Back bone of Tesbo

Understanding and setting up config.json file. #

Config.json file used for configuring the Test Execution in Tesbo. Configuration like list of browsers you need to run tests, URL of your test application etc… 

Config file should be on the project level

In Tesbo, config.json has predefined configuration for the test execution which are list as below.

Setup base URL #

In Tesbo, you can define by which parameter you need to run your tests, let’s say you need to execute your application tests with URL, you can pass your base URL again as baseUrl in the config.json file.         For example, 

 "run": {
          "baseUrl": "https://www.google.co.in/"
         }

Run with Selenium Grid or On the Any cloud platform like Saucelab, Crossbrowser testing #

 Selenium Grid is the part of the Selenium project, which has specialisation for running tests parallel across the different browsers with multiple machines and also multiple operating systems. To enable Selenium Grid execution, you’ll need to pass the Selenium Hub address as seleniumAddress along side with baseUrl in the config.json file.      For example,   

      "run": {
          "baseUrl": "https://www.google.in/",
          "seleniumAddress": "http://192.168.0.5:4444/wd/hub",
          "by": {
            "suite": [
              "<suiteName>"
            ]
          }
      }

Run By Tag  #

If you’ve noticed previously, we can add tag into the test in tests file, and when you need to run only test cases with those particular tags you can pass that Tag Name here in config.json file for execution.    For example,    I need to run those tests form multiple tests file which has tag as #regression, I can define that tag in here and can execute only regression test scripts.   

      "tag": ["<Enter Tag Name>"]

      i.e.

 "run": {     
   "by": {
            "tag": [
              "regression"
            ]
        }
 }

                    Even you can run your tests with multiple tags too.      For example,

 "run" : {    
  "by": {
          "tag": [
            "regression",
            "login",
            "cart"
          ]
      }
}

Run By Suite #

Tesbo is not just only limited to run with tag but also you can run your test by list of suites only too. For this again, you’ll need to pass the suite names in the suite parameter in config.json file.   For example, 

      "suite": ["<Enter Suite Name>"]   

i.e.

"run" : { 
      "by": {
            "suite": [
              "customer_login"
            ]
        }
}

Even you can run your tests with multiple suites too.    For example,       

 "run" : {    
 "by": {
          "suite": [
            "customer_login",
            "customer_dashboard",
            "admin_login"
          ]
      }
}
 You can run single functionality only(By Tag or By Suite).   

Run on various Browser #

In Tesbo, you can select in which browser you need to run your test scripts, You can configure the browser name in config.json by browser and name parameters.  

The plus point is you also don't need to configure browser binaries in Tesbo to execute scripts in Chrome or Firefox or in Internet Explorer. Tesbo will automatically handle this.

   For example, 

      "name": ["<Browser Name>"]  

 i.e.

"run" : { 
       "browser": {
             "name": [
               "chrome"
             ]
         }
   }

To run your tests in multiple browser you can also pass multiple browser name and your test will run one by one in different browser.    For example,

"run" : {   
  "browser": {
          "name": [
            "chrome",
            "firefox"
          ]
      }
  }

Setting Binaries Path (for additional driver) #

If in case sometimes your test will need an additional driver, and for that you can also pass the browser binary manual as well as below in config.json file.   For example,

"run" : {   
  "binaries": {
          "chromePath": ""
        }
 }

    i.e.

  "run" : {
        "binaries": {
              "chromePath": "E:\chromedriver.exe"
          }
   }

Run Test in Parallel #

One of the advantage in Tesbo is, unlike other tools Tesbo supports the parallel test execution as well. So running your test in parallel with different machines will lead faster test execution and eventually will save your time. To execute your test parallel in Tesbo you need to define the parallel parameter and inside it you need to pass status as true or false depend upon if you need to run or not. The parameter count will used for creating how many different instance you need to create while executing the test in parallel.   For example,     

"run" : {    
  "parallel": {
          "status": true,
          "count": "1"
      }
  }

Retry failed test scenarios #

Retry Analyzer is used when your tests are failing due to some unintended problems. In config.json you’ll need to pass the RetryAnalyser as below with retryAnalyser keyword. You need to pass the count to retry your failed scenario that many times. If you pass “0” in it it won’t retry your failed scenario.   For example,  

"run" : {   
  "retryAnalyser": {
          "count": "2"
      }     
  }       

 Single Window Run You can run all your test scripts in Single window with the Tesbo, for that you need to pass the SingleWindowRun parameter in your config.json file. In Single Window Run, functionality like Session and parallel will not run. For the disabling parallel test you need to pass status as false.

      "SingleWindowRun": true

Highlight element #

Tesbo supports highlight element as well for the highlighting the element before doing any action which also help tester to understand the flow of the tests. To use element highlight while running test you need to pass highlightElement as true in the config.json file. 

      "highlightElement": true    

Element highlight will look like as below when script is running.    https://imgur.com/mmVpvms.png

Locator Preference  #

As you remember, Tesbo takes all the worries to define the type of the locator when you declare them into the locator.json. but this make Tesbo little bit slow as Tesbo is trying to identify which kind of locator you have passed  and then find it on Page.   Locator preference will help to speedup this process by define the specific locator type into the config. By define them Tesbo will quickly identify the type and find the location on the page.  For example,  

     "run": {  
               "locatorPreference" : ["xpath", "id", "className"]   
     }

Possible type of the Locator Preference :  

  1. cssSelector, 
  2. Xpath, 
  3. id, 
  4. cssName, 
  5. name, 
  6. tagName, 
  7. linkText, 
  8. partialLinkText 
Once you define the Locator preference, Tesbo will only accept defined locator types, it will throw element not found exception. 

Multiple Environment #

In large scale project sometimes it’s required to test in different environment.   #

Tesbo provides a feature to execute a project in different environment. Like Development, Test , QA , Production environment. #

 For example,  

 "run" : {  
   "Environment": {  
               "stage" : "https://www.stage.google.com",
               "QA" : "https://www.qa.google.com"
     } 
 }

 To execute environment we should pass argument #

     -e stage 

Example of config.json file     #

    {
      "run": {
        "baseUrl": "https://www.google.in/",
        "seleniumAddress": " ",
        "by": {
          "tag": [
            "Gmail_signUp"
          ]
        },
        "browser": {
          "name": [
            "chrome"
          ]
        },

        "parallel": {
          "status": true,
          "count": "1"
        },

        "retryAnalyser": {
          "count": "1"
        },

        "binaries": {
          "chromePath": ""
        },

        "capabilities": {
          "chrome": {
            "version": "Value",
            "platform": "Value"
          }
        },

        "SingleWindowRun": false,
        "highlightElement": true,
        "locatorPreference" : ["xpath", "id", "className"]

      }

    }

Powered by BetterDocs

Leave a Comment