img

Introduction to config.json – Tesbo

As already seen the few of the Tesbo files like Runners, Locators, and Suites, but yet you might get a question in your mind maybe or maybe not that How we’re going to run this without any browser or URL passed to the code. Definitely Tesbo need to know where your all codes, locators and suites are located and for thst you need to define the config.json where you can pass this details for the configuration. For that Tesbo has another and we can say an important file named, config.json. config.json is called the core part for running the Tesbo automation. In config.json you can provide all the important configuration from the automation perspective such as URL, Browser Name, Capabilities, Parallel Execution etc.. Following are the few important test configuration you can define in your config.json file.
  • SuiteDirectory path
The core of Tesbo is the suite files which we have define previously. All the suite files are basically inside a directory called Suite, as Tesbo will run the steps and verification directly from this suites, you need to tell Tesbo about where all the suites file are located so that Tesbo can communicate with it. You can define it as below in your config.json file.

  "SuiteDirectory": " <Suite Directory Path>"
  i.e. 
    "SuiteDirectory": "E:/tesbo/test/java/suite"

  • LocatorDirectory path
After setting up the Suite directory again you need to tell tesbo where ro look for the locators. Suite filess will use the locators directly from the locator.json files and you need to provide path in config.json to communicate Tesbo with it.  You can define it as below in your config.json file.

  "locatorDirectory": " <Locator Directory Path>"
   i.e. 
     "locatorDirectory": "E:/tesbo/test/java/locator"

  • ExtCodeDirectory path
Again, this one is not mandatory part but again doing automation in real time projects aren’t that easy it seems. Definitely, you’ll need some conditions and also some of the custom functionalities from your project where Tesbo would not help, but Tesbo helps you to implement those by External Code. Also like locators, you’ll need ExtCode defined in your suite files and again Tesbo will need to check where all your external codes are lying and from where it can communicate. For that, you also need to pass the ExtCode path to your config.json file.

 "ExtCodeDirectory": " <ExtTestCode Directory Path>"
   i.e. 
     "ExtCodeDirectory": "E:/tesbo/test/java/ExtTestCode"

  • Base URL
What would be the next? You’ll need the Application URL definitely for running your automation. Now in Tesbo you can pass that Base URL in config.json, and Tesbo will take care other things to handle the URL and other. You can pass the Base URL by the baseUrl in the Tesbo.

"run": {
      "baseUrl": "https://www.google.co.in"
      "by": {
        "suite": [
          "<suiteName>"
        ]
      }
  }

  • Run with Grid
Selenium Grid is the part of the Selenium project, which has specialization for running tests parallel across the different browsers with multiple machines and also multiple operating systems. Whenever any tool is introduced always question asked by the expert about the Parallel Execution if it’s capable or not. Yes, Tesbo can run the tests in parallel! For running the Selenium Grid in remote, you’ll always need the Remote address of hub. Here in Tesbo, you also need to pass that Hub address only to your config.json file. You can pass hub address in config.json with 
seleniumAddress key.

"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 define tests by tags too in suite 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. Tesbo also supporting the Tags in .suite file, Tags are useful when you want to run the selected bunch of test scenarios only. For example if you need to run the Regression Tests from the suite, you can pass #regression tag for all the Regression Test script and when you’ll assign Tag to your config.json file, it’ll run only test with #regression tag from the suites. Here if I’ll define tag #regression, it’ll run only regression test.

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

  i.e.
// Run by Single Tag
    "by": {
        "tag": [
          "regression"
        ]
    }

//Run by Multiple Tags
  "by": {
        "tag": [
          "regression",
          "login",
          "cart"
        ]
    }

  • Run by Suite
Tesbo not limited only to run with Tags, but even you can also run your test by suites too. What you need to do is pass the suite name in the config.json file with suite key only. That’s all, Tesbo will get that suite name will execute your tests by suites. Isn’t that easy!

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

  i.e.
// Run only Single Suite
    "by": {
        "suite": [
          "customer_login"
        ]
    }

//Run Multiple Suites
   "by": {
        "suite": [
          "customer_login",
          "customer_dashboard",
          "admin_login"
        ]
    }

  • Run by Browsers
Another important aspect while running the automation is in which browser you want to run your automation script. In Tesbo you can define browser names, in which you need to run the automation. the main advantage here is you don’t need to configure the Browser binaries in the Tesbo for running the browser, Tesbo will automatically understand and run the execution for the particular browsers only. You can add browser name with the browser and name parameters in config.json file.

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

   i.e.
//Single Browser Run
     "browser": {
         "name": [
           "chrome"
         ]
     }

//Multiple Browser Run
     "browser": {
        "name": [
          "chrome",
          "firefox"
        ]
    }

  • 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 instances you need to create while executing the test in parallel.

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

  • Retry Failed test Scenarios
RetryAnalyser is used when your tests are failing due to some unintended problems. Let’s say you’re running 5 test scenarios and one of them is failed due to it can’t login and so can’t move further. The failure of login is unintended as in other 4 it’s logged in successfully but in 5th scenario due to time taken in page load, it failed to login.
Note: Retry Analyser is not working with single window functionality. As count passed as 2, Tesbo will retry your failed test two times to check if it’s actual failure or not.

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

  • Setting Binaries Path (for additional driver)
In Tesbo, as we mentioned earlier you don’t need to pass the browser binaries to run the browsers, but sometimes like running multiple sessions for the automation script you might need the other browser sessions, for this you can pass the external browser binary path from your machine to the script bu config.json as below.

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

i.e.
    "binaries": {
          "chromePath": "‪E:\chromedriver.exe"
    }

  • Browser Capabilities
URL done, browser done, parallel done, but yet sometimes happen you’ll require to add some custom browser capabilities in your code too. Tesbo is capable to pass this capabilities in the config.json file. You can pass the capabilities by the browser name itself.

"capabilities": {
      "chrome": {
        "version": "<version num>",
        "platform": "<platform name>"
      }
 }

  • 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. Note: 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

Below is the small example of the Tesbo config.json, how it looks like with parameters.

{
  "SuiteDirectory": "E:/tesbo/src/test/suite",
  "locatorDirectory": "E:/tesbo/src/test/locator",
  "ExtCodeDirectory": "E:/tesbo/src/test/ExtTestCode",
  "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
  }
}

  • Facebook
  • Twitter
  • Google+
  • Linkedin
  • Pinterest

Leave a Comment

Your email address will not be published. Required fields are marked *

It is main inner container footer text
Accessibility