Search code examples
chatbot

Can we run BotiumCLI-WebdriverIO in a headful mode and (or) Selenium Grid? If yes, can how can we modify the Botium.json to achieve this?


I am using Botium-CLI and WebdriverIO connector. I am unable to find any documentation which explains how to run the driver in headful mode (its headless by default) and also how can we modify the botium.json to trigger execution in Selenium Grid. I tried use this, didn't work :

"WEBDRIVERIO_OPTIONS": {
        "capabilities": {
          "browserName": "chrome"
        }
        "protocol": "http",
        "host": "localhost",
        "port": "4444",
        "path": "/wd/hub"
      }

Please note, I am looking for solutions for Botium CLI, not Botium Box.


Solution

  • With Botium Webdriver Connector, there are basically 4 ways to use Selenium.

    1. As noticed in the question a headless Chrome can be used, see Github docs.

    2. Botium can make use of Selenium Standalone to launch a local Selenium service on test execution, see Github docs. It requires some preparation to install the browser-specific webdrivers.

    3. Botium can connect to your local Selenium server. You can launch your own with the help of Docker - there are instructions available for Botium Box in the Botium Box Wiki, but most of it applies to Botium CLI as well - you you have to configure the Selenium endpoint in the botium.json:

        "WEBDRIVERIO_OPTIONS": {
            "capabilities": {
              "browserName": "chrome"
            }
            "protocol": "http",
            "host": "my-selenium-server",
            "port": "4444",
            "path": "/wd/hub"
        }
    
    1. Finally, you can also connect to a cloud device service like Saucelabs - every provider with a public Selenium endpoint should work. Parameters are to be given in the botium.json:
          "WEBDRIVERIO_OPTIONS": {
            "capabilities": {
              "deviceName": "Samsung Galaxy S6 GoogleAPI Emulator",
              "platformName": "Android",
              "platformVersion": "7.0",
              "browserName": "Chrome",
              "__browserName": "chrome",
              "name": "Banking Chatbot Tests",
              "tags": "botium, chatbot",
              "username": "xxx",
              "accessKey": "xxxxx"
            },
            "protocol": "https",
            "hostname": "ondemand.saucelabs.com",
            "port": 443
          }