{"id":15524370,"url":"https://github.com/codeforequity-at/botium-connector-webdriverio","last_synced_at":"2025-04-19T13:49:26.044Z","repository":{"id":53177278,"uuid":"143603747","full_name":"codeforequity-at/botium-connector-webdriverio","owner":"codeforequity-at","description":"Botium Connector for WebdriverIO scripts","archived":false,"fork":false,"pushed_at":"2024-05-06T12:25:07.000Z","size":641,"stargazers_count":4,"open_issues_count":2,"forks_count":5,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-06T08:36:26.487Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.botium.ai","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeforequity-at.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-05T10:34:56.000Z","updated_at":"2024-05-06T12:24:42.000Z","dependencies_parsed_at":"2023-11-13T14:29:34.652Z","dependency_job_id":"3c31158b-1273-49e2-8b5a-ca5bc5c5a4e2","html_url":"https://github.com/codeforequity-at/botium-connector-webdriverio","commit_stats":{"total_commits":172,"total_committers":7,"mean_commits":"24.571428571428573","dds":"0.39534883720930236","last_synced_commit":"30cd4845db672b70cb8451ce1bca2ea110979e2b"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforequity-at%2Fbotium-connector-webdriverio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforequity-at%2Fbotium-connector-webdriverio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforequity-at%2Fbotium-connector-webdriverio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforequity-at%2Fbotium-connector-webdriverio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeforequity-at","download_url":"https://codeload.github.com/codeforequity-at/botium-connector-webdriverio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249707248,"owners_count":21313800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T10:51:06.125Z","updated_at":"2025-04-19T13:49:26.024Z","avatar_url":"https://github.com/codeforequity-at.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Botium Connector for WebdriverIO scripts\n\n[![NPM](https://nodei.co/npm/botium-connector-webdriverio.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/botium-connector-webdriverio/)\n\n[![npm version](https://badge.fury.io/js/botium-connector-webdriverio.svg)](https://badge.fury.io/js/botium-connector-webdriverio)\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg)]()\n\nSupports running [Botium](https://github.com/codeforequity-at/botium-core) scripts on Websites with Webdriver, backed by a Selenium server.\n\n__Did you read the [Botium in a Nutshell](https://medium.com/@floriantreml/botium-in-a-nutshell-part-1-overview-f8d0ceaf8fb4) articles ? Be warned, without prior knowledge of Botium you won't be able to properly use this library!__\n\nThis is technical documentation on a rather low level. As introduction to E2E-Testing with Botium, here are are links to some articles you should read first:\n* [Botium in a Nutshell, Part 6: E2E-Testing with Botium Box](https://medium.com/@floriantreml/botium-in-a-nutshell-part-6-e2e-testing-with-botium-box-9bd8acdf5a70)\n* [Run Selenium Grid and Connect to Botium Box](https://botium.atlassian.net/wiki/spaces/BOTIUM/pages/32145510/Run+Selenium+Grid+and+Connect+to+Botium+Box)\n\n## Attention: Breaking Change with Version 0.2.0\n\u003cfont color='red'\u003eWith Version 0.2.0 of this connector we switched [from Webdriver 4 to Webdriver 5](https://webdriver.io/blog/2018/12/19/webdriverio-v5-released.html). To continue using Webdriver 4 with your Selenium scripts, use the NPM package **botium-connector-webdriverio4** instead of **botium-connector-webdriverio**.\u003c/font\u003e\n\n## How it works ?\nBotium uses the [Webdriver.io](https://webdriver.io/) library to run conversations against a chatbot running on a website.\n\nIt can be used as any other Botium connector with all Botium Stack components:\n* [Botium CLI](https://github.com/codeforequity-at/botium-cli/)\n* [Botium Bindings](https://github.com/codeforequity-at/botium-bindings/)\n* [Botium Box](https://www.botium.at)\n\n## Requirements\n\n* __Node.js and NPM__\n* a chatbot running on a website\n* a __project directory__ on your workstation to hold test cases and Botium configuration\n\n## Install Botium and Webdriver IO Connector\n\nWhen using __Botium CLI__:\n\n```\n\u003e npm install -g botium-cli\n\u003e npm install -g botium-connector-webdriverio\n\u003e botium-cli init\n\u003e botium-cli run\n```\n\nWhen using __Botium Bindings__:\n\n```\n\u003e npm install -g botium-bindings\n\u003e npm install -g botium-connector-webdriverio\n\u003e botium-bindings init mocha\n\u003e npm install \u0026\u0026 npm run mocha\n```\n\nWhen using __Botium Box__:\n\n_Already integrated into Botium Box, no setup required_\n\n## Preparation Steps: Selenium server\n\nAn installed and running Selenium server is required. If you don't have a Selenium server already installed (or access to a cloud based Selenium server like Saucelabs), you can use the scripts in this repository as a starter to either install a full-blown Selenium server, or just a headless Chrome browser.\n\n### Installing and starting the Selenium server (with Chrome, Edge, Firefox)\n\nAs a starter, this repository includes scripts for installing and starting a Selenium server with the help of [selenium-standalone](https://github.com/vvo/selenium-standalone)-package. \n\n#### Preparation\n\nFirst, you have to install a recent Java Runtime Environment - see [here](https://github.com/vvo/selenium-standalone#ensure-you-have-the-minimum-required-java-version) for required versions. An of course, you need Node.js and Git client.\n\nClone the repository:\n\n`\u003e git clone https://github.com/codeforequity-at/botium-connector-webdriverio.git`\n\nInstall requirements, Selenium server and drivers for the most common browsers\n\n```\n\u003e npm install\n\u003e npm run selenium-install\n```\n\nIt downloads and installs the __latest webdrivers for common browsers__. Maybe you will have to install a previous version of the webdriver for a browser, in case you havn't installed the latest version of the browser - this is possible, but out of scope for this documentation, please consult the [selenium-standalone](https://github.com/vvo/selenium-standalone)-documentation.\n\n_Note: in case of troubles with Selenium installation, this project is not the right place to ask, as it is almost surly a problem with Selenium, not with Botium._\n\n#### Start the integreated Selenium server\n\nTo automatically start the integrated Selenium server when Botium is executing, use the **WEBDRIVERIO_START_SELENIUM** capability (see below).\n\n#### Start the Selenium server from command line\n\n```\n\u003e npm run selenium\n```\n\nWith this running Selenium server you can now run the Botium samples.\n\n### Using headless Chrome\n\nAs a very small replacement you can also start with headless Chrome browser. You won't need a separate Selenium installation in this case.\n\nSetting the capability \"WEBDRIVERIO_START_CHROMEDRIVER\" to true will make Botium start an integrated Chrome automatically (and stop it afterwards).\n\n**ATTENTION** The version of the included chromedriver in this repository may not match your installed version - the error output is something like this:\n\n    This version of ChromeDriver only supports Chrome version XX\n\nIn this case you will either have to install the requested Chrome version, our have to update the chromedriver library to match your Chrome version. If you have Chrome 83.xxx installed, you can do this:\n\n    \u003e npm install chromedriver@83 --no-save\n\n## Preparation Steps: Analyze Chatbot Widget\n\nIf you ever worked with Selenium, you are aware that writing an automation script usually is a time-consuming task. This Botium connector helps you in writing automation scripts for a chatbot widget embedded on a website and speeds up the development process by making reasonable assumptions:\n* There maybe is some kind of click-through to actually __open the chatbot__\n* The chatbot has an __input text field__, or some buttons to click (however it looks)\n* The chatbot outputs reponses in some kind of __list within a window__ (however it looks)\n\nAll those assumptions can be parameterized for adapting it to your actual chatbot website with Botium capabilities:\n\n* _WEBDRIVERIO_URL_ to point to the website to launch for accessing the chatbot\n* _WEBDRIVERIO_INPUT_ELEMENT_, the [Webdriver selector](https://webdriver.io/docs/selectors.html) for the input text field\n* _WEBDRIVERIO_INPUT_ELEMENT_SENDBUTTON_, the [Webdriver selector](https://webdriver.io/docs/selectors.html) for the \"Send\"-Button (if present, otherwise message to the chatbot is sent with \"Enter\" key)\n* _WEBDRIVERIO_OUTPUT_ELEMENT_, the [Webdriver selector](https://webdriver.io/docs/selectors.html) for the chatbot output elements\n\nIf there are additional steps (mouse clicks) to do on the website before the chatbot is accessible, you will have to extend the pre-defined Selenium scripts with custom behaviour (see below).\n\nFor some common chatbot widgets and websites, Botium provides out-of-the-box Selenium scripts by setting the Botium capability __WEBDRIVERIO_PROFILE__ to one of the pre-defined Selenium scripts.\n\n### botbuilder_webchat_(version) - Microsoft Bot Framework Webchat\nFor chatbots published with the [Bot Framework Webchat Widget](https://github.com/Microsoft/BotFramework-WebChat). Point the capability _WEBDRIVERIO_URL_ to the full URL of the website where the widget is embedded.\n\nCurrently supported:\n\n* botbuilder_webchat_v3\n* botbuilder_webchat_v4\n* botbuilder_webchat_v4_10_0\n\n### dialogflow_com - Dialogflow Web Demo Chatbot\nFor chatbots published as Dialogflow \"Web Demo\". Point the capability _WEBDRIVERIO_URL_ to the full URL of the embedded Dialogflow Web Demo (for example: \"https://console.dialogflow.com/api-client/demo/embedded/d388ac41-5c60-483f-b89b-0ec0d99d848d\").\n\n### watsonpreview - IBM Watson Assistant Preview Link\nFor Watson Assistant chatbots published as [Preview Link](https://cloud.ibm.com/docs/services/assistant?topic=assistant-deploy-web-link). Point the capability _WEBDRIVERIO_URL_ to the full URL of the chatbot page (for example: \"https://assistant-chat-eu-de.watsonplatform.net/web/public/xxxxxxx\").\n\n### whatsapp - Whatsapp\nWhatsapp is started via Appium, a contact is opened, the chat history with this contact is cleared and the conversation is run.\n\nSome caveats:\n* Whatsapp has to be already installed end registered on the phone. When using device cloud providers, this is only possible with a private device cloud.\n* The contact name of the bot has to be configured (*WEBDRIVERIO_CONTACT*) and a first conversation has to be done manually to make it visible in the conversations view of Whatsapp.\n* The language of the Whatsapp app has to be configured (*WEBDRIVERIO_LANGUAGE*) for naming the menu items. See *profiles/whatsapp.js*.\n\n## Customize pre-defined Selenium Scripts\nWhile the pre-defined Selenium scripts make reasonable assumptions, it is not unusual that your chatbot widget and your website has some very special behaviour to address. In those cases, there are some Selenium- and Node.js-Coding skills required.\n\nCustomization is done by injection Node.js-Code into Botium. The code to executed is injected by providing a capability to Botium. The capability can contain:\n\n* a pointer to a _Javascript Function_ (not possible when configuration is done in _botium.json_ file)\n* the name of an _NPM Package_, which exports a single function\n* a _Javascript file name_ relative to the current working directory, which exports a single function (see below)\n\n**See _botium.json_ in the _samples/custom_ folder for examples**\n\n### Placing code in a Javascript file\n\nWhen placing code in a Javascript file, make sure to export exactly one function. The function has to return a Promise. The parameters handed over to the function are described below.\n\n```\nmodule.exports = async (container, browser) =\u003e {\n  const startChat = await browser.$('#StartChat')\n  await startChat.waitForClickable({ timeout: 20000 })\n  await startChat.click()\n}\n```\n### Parameters\n\n**container**\n\nHas references to:\n* _container.caps_: the list of Botium capabilities. Use it like: _container.caps['MY_CAP_NAME']_\n* _container.findElement_ and _container.findElements_: mirror the Webdriver _$_- and _$$_-functions for finding HTML elements in the page, but also consider Shadow DOM\n\n**browser**\n\nThe current Webdriver browser session\n\n### WEBDRIVERIO_OPENBROWSER\nPre-defined behaviour:\n* Opening website url\n* Wait for page title\n* Setting viewport size\n\nThis has to be customized rarely.\n\nExtension function called with arguments: _container_, _browser_\n\n### WEBDRIVERIO_OPENBOT\nPre-defined behaviour:\n* If there are buttons configured (see _WEBDRIVERIO_INPUT_NAVIGATION_BUTTONS_), click them one after the other\n* Waiting until the input text field is visible\n\nThis has to be customized in most cases - for example, to click away the typical \"Cookie\"-warning from a website, clicking on the chatbot button at the bottom right of the website, ... \n\nThe _samples/custom_ folder has an example for this scenario.\n\nExtension function called with arguments: _container_, _browser_\n\n### WEBDRIVERIO_SENDTOBOT\nPre-defined behaviour:\n* Set value of text input field\n* Send \"Enter\" or simulate button click (if WEBDRIVERIO_INPUT_ELEMENT_SENDBUTTON capability is available)\n\nThis has to be customized rarely.\n\nExtension function called with arguments: _container_, _browser_, _msg\n\n### WEBDRIVERIO_RECEIVEFROMBOT\nPre-defined behaviour:\n* Poll for new chatbot response elements\n\nThis has to be customized rarely.\n\nExtension function called with arguments: _container_, _browser_\n\n### WEBDRIVERIO_GETBOTMESSAGE\nPre-defined behaviour:\n* Chatbot output is the text value of the chatbot response elements\n\nThis has to be customized sometimes. This extension function is responsible for extracting the chatbot output from the HTML element (as notified from the _WEBDRIVERIO_RECEIVEFROMBOT_ function) and converting it to a Botium message.\n\nExtension function called with arguments: _container_, _browser_, _elementId_\n\n## Webdriver Settings (Select Browser)\n\nConfiguration of the Webdriver and Selenium is not done by Botium itself, but by passing on the content of the capability _WEBDRIVERIO_OPTIONS_ to [Webdriver.io](https://webdriver.io/docs/options.html).\n\nThis example selects Chrome browser:\n\n```\n{\n  \"botium\": {\n    \"Capabilities\": {\n      ...\n      \"WEBDRIVERIO_OPTIONS\": {\t\n        \"capabilities\": {\n          \"browserName\": \"chrome\"      \n        }\n      }\n      ...\n    }\n  }\n}\n```\n\nThis example selects the cloud device provider Saucelabs:\n\n```\n{\n  \"botium\": {\n    \"Capabilities\": {\n      ...\n      \"WEBDRIVERIO_OPTIONS\": {\n        \"capabilities\": {\n          \"deviceName\": \"Samsung Galaxy S6 GoogleAPI Emulator\",\n          \"platformName\": \"Android\",\n          \"platformVersion\": \"7.0\",\n          \"browserName\": \"Chrome\",\n          \"name\": \"Banking Chatbot Tests\",\n          \"tags\": \"botium, chatbot\",\n          \"username\": \"xxx\",\n          \"accessKey\": \"xxxxx\"\n        },\n        \"hostname\": \"ondemand.saucelabs.com\",\n        \"port\": 80\n      },\n      ...\n    }\n  }\n}\n```\n\n## Running the samples\n\n```\n\u003e cd samples/dialogflow\n\u003e npm install \u0026\u0026 npm test\n```\n\n(This sample will use the a headless Chrome brwoser)\n\nCheck the botium.json files in the sample directories for setting up the browser to use for the Botium conversation. You maybe have to tune the Selenium capabilities in the botium.json file - again, in case of troubles with Selenium, this project is not the right place to ask.\n\n## Supported Capabilities\n\nSet the capability __CONTAINERMODE__ to __webdriverio__ to activate this connector.\n\n### WEBDRIVERIO_OPTIONS\nThe [Webdriver.io](https://webdriver.io/docs/options.html)-Options (see above)\n\n### WEBDRIVERIO_URL\nThe url to open in the browser\n\n### WEBDRIVERIO_APP\nThe app to install. See [Appium documentation](http://appium.io/docs/en/writing-running-appium/caps/)\n\n### WEBDRIVERIO_APPPACKAGE / WEBDRIVERIO_APPACTIVITY\nThe app package and activity to test. See [Appium documentation](http://appium.io/docs/en/writing-running-appium/caps/)\n\n### WEBDRIVERIO_APPNORESET\nReset app state before testing. See [Appium documentation](http://appium.io/docs/en/writing-running-appium/caps/)\n\n### WEBDRIVERIO_USE_APPIUM_PREFIX\nDepending on the Selenium infrastructure an \"appium:\" prefix for the Appium-specific capabilities might be required.\nCheck the documentation of your device cloud provider or your Selenium grid.\n\n### WEBDRIVERIO_HTTP_PROXY / WEBDRIVERIO_HTTPS_PROXY / WEBDRIVERIO_NO_PROXY\nHTTP(S) proxy settings and exception rules used between browser and internet - see [here](https://webdriver.io/docs/proxy.html).\n\nSample configuration:\n\n    ...\n    \"WEBDRIVERIO_HTTP_PROXY\": \"my-corporate-proxy-host:some-port\",\n    \"WEBDRIVERIO_HTTPS_PROXY\": \"my-corporate-proxy-host:some-port\",\n    \"WEBDRIVERIO_NO_PROXY\": \"*.internal.addresses\",\n    ...\n\n### WEBDRIVERIO_VIEWPORT_SIZE\nSet browser view port size to dimensions\nExample:\n\n    ...\n    WEBDRIVERIO_VIEWPORT_SIZE: { width: 1280, height: 768 },\n    ...\n\n### WEBDRIVERIO_PROFILE\nChoose pre-defined Selenium scripts (see above)\n\n* messenger_com - Facebook Messenger (experimental)\n* dialogflow_com - Google Dialogflow Web Demo\n* botbuilder_webchat_v3 - MS BotBuilder Webchat (v3)\n* botbuilder_webchat_v4 - MS BotBuilder Webchat (v4)\n* watsonpreview - IBM Watson Assistant Preview Link\n\n### WEBDRIVERIO_OPENBROWSER\nExtension function to start up the browser (see above)\n\n### WEBDRIVERIO_OPENBOT\nExtension function to navigate to the chatbot and/or make the chatbot visible after opening the url in the browser (see above)\n\n### WEBDRIVERIO_OPENBOTPAUSE\nPause execution for given amount of milliseconds after the chatbot is visible (maybe waiting for initialization)\n\n### WEBDRIVERIO_SENDTOBOT\nExtension function to send a message to the chatbot (see above)\n\n### WEBDRIVERIO_RECEIVEFROMBOT\nExtension function to gather chatbot response (see above)\n\n### WEBDRIVERIO_GETBOTMESSAGE\nExtension function to extract the message from the chatbot response element (see above)\n\n### WEBDRIVERIO_SHADOW_ROOT\nThe root element selector for chatbots hosted within a [Shadow DOM](https://wiki.selfhtml.org/wiki/HTML/Web_Components/Shadow_DOM)\n\n### WEBDRIVERIO_IMPLICIT_TIMEOUT\n_DEFAULT: 10s_\nImplicit timeout for all element locators\n\n### WEBDRIVERIO_INPUT_NAVIGATION_BUTTONS\nA list of [Webdriver selectors](https://webdriver.io/docs/selectors.html) for clickable elements which will be clicked one after the other to navigate to the actual chatbot widget.\n\nOptional/mandatory steps:\n* For a selector starting with _!_ any failure will stop script execution (the default)\n* For a selector starting with _?_ any failure will be shown in the log but script execution will continue\n\nClicking elements:\n* Starting a selector with _click:_ will wait for the element to be clickable and then apply a click to it\n* This is also the default behaviour, if none of the other magic words is used\n\nMagic words for elements:\n* Starting a selector with _waitForDisplayed:_ will wait for the element to be displayed\n* Starting a selector with _waitForClickable:_ will wait for the element to be clickable\n* Starting a selector with _waitForEnabled:_ will wait for the element to be enabled\n* Additional parameter can be given to specify the timeout period _waitForDisplayed:#button-id:5000_ (waiting 5000ms for a button)\n\nMagic words for iFrame navigation:\n* Starting a selector with _iframe:_ will switch all subsequent selectors to the iFrame selected by the selector\n* Switching back to the iFrame parent can be done with the selector with _iframe:parent_\n\nMagic words for Window/Tab navigation:\n* Starting a selector with switch:_ will switch the context to the window/tab with the given title/url\n\nMagic words for form field input:\n* Starting a selector with _setvalue:_ will set the value of an input field. Value and input field selector are part of the element: _setvalue:value-to-set:my-field-selector_\n* Starting a selector with _addvalue:_ will append the value to an input field. Value and input field selector are part of the element: _addvalue:value-to-append:my-field-selector_\n* Starting a selector with _sendkeys:_ will send the keys to an input field. Value and input field selector are part of the element: _sendkeys:value-to-send:my-field-selector_\n* When using _Enter_ as value then the Enter key will be sent instead\n\nMagic words for Hybrid smartphone apps:\n* Starting a selector with _context:_ will switch the context to an embedded webview, for example _context:webview_ (for a named context) or _context:1_ (by index)\n\nOther magic words:\n* _pause:1000_ will pause for 1 second (1000ms)\n* _dumphtml_ will dump the current page source to the botiumwork directory\n\n### WEBDRIVERIO_INPUT_ELEMENT\n[Webdriver selector](https://webdriver.io/docs/selectors.html) for the input text field\n\n### WEBDRIVERIO_INPUT_ELEMENT_VISIBLE_TIMEOUT\n_Default: 10000ms (10 sec)_\n\nWait for the input element to become visible. If not visible within this amount of milliseconds, test fails.\n\n### WEBDRIVERIO_INPUT_ELEMENT_SKIP_WAITFORDISPLAYED\n_Default: false_\n\nBy default, wait for input element to show up on start. Can be disabled.\n\n### WEBDRIVERIO_INPUT_ELEMENT_SENDBUTTON\nSimulate button click for sending a text message (if not set: _Enter_ key is simulated)\n\n### WEBDRIVERIO_INPUT_ELEMENT_BUTTON\n_Default: (lowercase selection on button or hyperlink text)_\n\n[Webdriver selector](https://webdriver.io/docs/selectors.html) for selecting the button to click for the user input method BUTTON in Botium Script:\n\n```\n#me\nBUTTON ClickMe\n```\n\nBy default, a button or a hyperlink showing the given text is selected, this should match most use cases. The capability is a [Mustache template](https://github.com/janl/mustache.js) and filled with the button text given in BotiumScript.\n\nFor example, if you want to select the button to click based on the _title_ attribute, use this Webdriver selector:\n\n_button[title*='{{button.text}}']_\n\n### WEBDRIVERIO_INPUTPAUSE\nIn some situations it might be required after a user input to wait for a short amount of time to wait for the user interface. In this case you can use this capability to specify an amount of milliseconds to pause execution shortly.\n\n### WEBDRIVERIO_OUTPUT_ELEMENT\n[Webdriver selector](https://webdriver.io/docs/selectors.html) for the chatbot output elements\n\n### WEBDRIVERIO_OUTPUT_ELEMENT_TEXT and WEBDRIVERIO_OUTPUT_ELEMENT_TEXT_NESTED\n[Webdriver selector](https://webdriver.io/docs/selectors.html) for selecting the text portion within the identified output elements - default behaviour is to just get the displayed text\n\nIf the selector is relative to the identified WEBDRIVERIO_OUTPUT_ELEMENT, set WEBDRIVERIO_OUTPUT_ELEMENT_TEXT_NESTED to _true_ (default).\n\n### WEBDRIVERIO_OUTPUT_ELEMENT_BUTTONS and WEBDRIVERIO_OUTPUT_ELEMENT_BUTTONS_NESTED\n_Default: .//button | .//a[@href]_\n\n[Webdriver selector](https://webdriver.io/docs/selectors.html) for selecting the buttons within the identified output elements - default behaviour is to read HTML buttons and hyperlinks\n\nIf the selector is relative to the identified WEBDRIVERIO_OUTPUT_ELEMENT, set WEBDRIVERIO_OUTPUT_ELEMENT_BUTTONS_NESTED to _true_ (default). Some chatbot widgets show Quick Response Buttons as overlay, not within the DOM of the chat window - for these cases, setting this capability to _false_ will help.\n\nSet the _WEBDRIVERIO_OUTPUT_ELEMENT_BUTTONS_PAUSE_ capability to pause execution for a few milliseconds to give the screen some additional time to render.\n\n### WEBDRIVERIO_OUTPUT_ELEMENT_EXTRA_BUTTONS\n_Default: empty_\n\n[Webdriver selector](https://webdriver.io/docs/selectors.html) for selecting additional buttons shown on the screen. Set the _WEBDRIVERIO_OUTPUT_ELEMENT_EXTRA_BUTTONS_PAUSE_ capability to pause execution for a few milliseconds to give the screen some additional time to render.\n\n### WEBDRIVERIO_OUTPUT_ELEMENT_MEDIA and WEBDRIVERIO_OUTPUT_ELEMENT_MEDIA_NESTED\n_Default: .//img | .//video | .//audio_\n\n[Webdriver selector](https://webdriver.io/docs/selectors.html) for selecting the media attachments within the identified output elements - default behaviour is to check for pictures, videos and audio attachments\n\nIf the selector is relative to the identified WEBDRIVERIO_OUTPUT_ELEMENT, set WEBDRIVERIO_OUTPUT_ELEMENT_MEDIA_NESTED to _true_ (default).\n\nSet the _WEBDRIVERIO_OUTPUT_ELEMENT_MEDIA_PAUSE_ capability to pause execution for a few milliseconds to give the screen some additional time to render.\n\n### WEBDRIVERIO_OUTPUT_ELEMENT_CARD*\nExtracting cards from the output element\n\n* WEBDRIVERIO_OUTPUT_ELEMENT_CARD\n* WEBDRIVERIO_OUTPUT_ELEMENT_CARD_KEY_ATTRIBUTE\n* WEBDRIVERIO_OUTPUT_ELEMENT_CARD_PAUSE\n* WEBDRIVERIO_OUTPUT_ELEMENT_CARD_TEXT\n* WEBDRIVERIO_OUTPUT_ELEMENT_CARD_SUBTEXT\n* WEBDRIVERIO_OUTPUT_ELEMENT_CARD_MEDIA\n* WEBDRIVERIO_OUTPUT_ELEMENT_CARD_BUTTONS\n\n### WEBDRIVERIO_OUTPUT_ELEMENT_HASH\n_Default: ELEMENTID_\n\nThe algorithm used to calculate a unique identifier for an identified output element. By default, the Webdriver element identifier is chosen, and this works in most cases. But depending on the level of dynamic content, it might be a better approach to use the output HTML content itself as (very long) identifier. This is recommended in those cases:\n\n* On iOs the Webdriver element identifier is not unique, so you have to rely on HTML content to be unique\n* If you have unique HTML content (in combination with _WEBDRIVERIO_OUTPUT_ELEMENT_HASH_SELECTOR_)\n* If you have a unique identifier in the HTML content (in combination with _WEBDRIVERIO_OUTPUT_ELEMENT_HASH_ATTRIBUTE_)\n* Depending on your test cases, _TEXT_ is a safe option (if there are no loops in the conversations)\n\nPossible values:\n\n* HASH - use parts of the HTML output (or an HTML attribute) as identifier (most stable)\n* INDEX - use the position in the output DOM as identifier (only if DOM is stable)\n* TEXT - use the displayed text as identifier (fallback if none of the above possible)\n* ELEMENTID - use the Webdriver element identifier (nearly unuseable)\n\n### WEBDRIVERIO_OUTPUT_ELEMENT_HASH_SELECTOR\n_Default: empty_\n\nIf _WEBDRIVERIO_OUTPUT_ELEMENT_HASH_ is **HASH**, then it is possible to specify a selector for the unique HTML content. \n\nFor instance, HTML for a bot message could look like this:\n\n```\n\u003cdiv class=\"bot-message\"\u003e\u003cdiv class=\"text\" id=\"1683949299888\"\u003eHey, meat bag!\u003c/div\u003e\u003c/div\u003e\n\n```\n\n* **WEBDRIVERIO_OUTPUT_ELEMENT** - //div[contains(@class,'bot-message')]\n* **WEBDRIVERIO_OUTPUT_ELEMENT_HASH** - HASH\n* **WEBDRIVERIO_OUTPUT_ELEMENT_HASH_SELECTOR** - ./div[contains(@class,'text')]\n\nOr it can also select something up the DOM tree:\n\n```\n\u003cdiv class=\"chat-bubble\" id=\"1683949299888\"\u003e\u003cdiv class=\"bot-message\"\u003e\u003cdiv class=\"text\"\u003eHey, meat bag!\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\n\n```\n\n* **WEBDRIVERIO_OUTPUT_ELEMENT** - //div[contains(@class,'bot-message')]\n* **WEBDRIVERIO_OUTPUT_ELEMENT_HASH** - HASH\n* **WEBDRIVERIO_OUTPUT_ELEMENT_HASH_SELECTOR** - ../div[contains(@class,'chat-bubble')]\n* **WEBDRIVERIO_OUTPUT_ELEMENT_HASH_ATTRIBUTE** - id\n\n### WEBDRIVERIO_OUTPUT_ELEMENT_HASH_ATTRIBUTE\n_Default: empty_\n\nIf _WEBDRIVERIO_OUTPUT_ELEMENT_HASH_ is **HASH**, then it is possible to specify the id attribute. \n\nFor instance, HTML for a bot message could look like this:\n\n```\n\u003cdiv class=\"bot-message\" id=\"1683949299888\"\u003e\u003cdiv class=\"text\"\u003eHey, meat bag!\u003c/div\u003e\u003c/div\u003e\n\n```\n\n* **WEBDRIVERIO_OUTPUT_ELEMENT** - //div[contains(@class,'bot-message')]\n* **WEBDRIVERIO_OUTPUT_ELEMENT_HASH** - HASH\n* **WEBDRIVERIO_OUTPUT_ELEMENT_HASH_ATTRIBUTE** - id\n\n### WEBDRIVERIO_OUTPUT_ELEMENT_DEBUG_HTML\n_Default: false_\n\nPrint the output element HTML content to the debug stream. Important for development phase, to actually see what Botium is receiving.\n\n### WEBDRIVERIO_IGNOREUPFRONTMESSAGES\n_Default: false_\n\nIf set, all chatbot responses received before first message is sent are ignored. This is for ignoring welcome messages and other things sent upfront from the chatbot (usage instructions, welcome back, ...)\n\n### WEBDRIVERIO_IGNOREWELCOMEMESSAGES\nIgnore a fixed number of messages received from the chatbot. For instance, if there are always 4 welcome messages displayed, set this capability to _4_ to ignore them.\n\n### WEBDRIVERIO_IGNOREEMPTYMESSAGES\n_Default: false_\n\nIf set, all recognized messages with don't include a text, buttons or media files are ignored. This is for ignoring messages without any content, for example a placeholder for a \"Bot is typing\" visualization.\n\n### WEBDRIVERIO_USERNAME and WEBDRIVERIO_PASSWORD\nLogin data if required\n\n### WEBDRIVERIO_CONTACT\nName of the contact if required (for example, in Whatsapp)\n\n### WEBDRIVERIO_LANGUAGE\nLanguage of the app if required (for example, to set the Whatsapp language)\n\n### WEBDRIVERIO_SCREENSHOTS\n_Default: none_\n\nMake screenshots and include it in the Botium message\n* _none_ - no screenshots\n* _onbotsays_ - attach screenshot after each received message\n* _onstop_ - attach screenshot after conversation is ready\n\n*Note: when debug mode is enabled (environment variable DEBUG=botium-connector-webdriverio\\*) screenshots are saved to the local directory on failure*\n\n### WEBDRIVERIO_START_SELENIUM and WEBDRIVERIO_START_SELENIUM_OPTS\n_Default: false_\n\n_Default opts: none (use default options)_\n\nStart the integrated Selenium server automatically.\n\nThe options are handed over to Selenium-standalone 1:1 - see [here](https://github.com/vvo/selenium-standalone#example) for examples how to adapt it to your driver versions.\n\n### WEBDRIVERIO_START_CHROMEDRIVER and WEBDRIVERIO_START_CHROMEDRIVER_ARGS/WEBDRIVERIO_START_CHROMEDRIVER_ADDITIONAL_ARGS\n_Default: false_\n\n_Default args: --port=4444 --url-base=wd/hub_\n\nStart the a headless Chrome browser automatically with the given args (WEBDRIVERIO_START_CHROMEDRIVER_ARGS). Use the WEBDRIVERIO_START_CHROMEDRIVER_ADDITIONAL_ARGS capability to add an additional arg to the default args\n\n### WEBDRIVERIO_START_CHROMEDRIVER_OPTIONS/WEBDRIVERIO_START_CHROMEDRIVER_ADDITIONAL_OPTIONS\n_Default: ['--headless', '--no-sandbox', '--disable-gpu', '--disable-dev-shm-usage', '--disable-extensions']_\n\nSet the options args for chromedriver (WEBDRIVERIO_START_CHROMEDRIVER_OPTIONS). Use the WEBDRIVERIO_START_CHROMEDRIVER_ADDITIONAL_OPTIONS capability to add an additional option arg to the default option args\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeforequity-at%2Fbotium-connector-webdriverio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeforequity-at%2Fbotium-connector-webdriverio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeforequity-at%2Fbotium-connector-webdriverio/lists"}