This should be doable with a Logic Hook - docs in the Botium Wiki.
The logic hook should implement the logic of
- getting access to the current Connector handle (container.pluginInstance)
- doing the things like clicking button and making selection
In the BotiumScript it will look like this:
LH_SELECT_MOBILE_NUMBER 056346444
In the botium.json, it will look like this:
{
"botium": {
"Capabilities": {
...
"LOGIC_HOOKS": [
{
"ref": "LH_SELECT_MOBILE_NUMBER",
"src": "src/lh_select_mobile_number.js"
}
]
}
}
}
And the file src/lh_select_mobile_number.js will look something like:
module.exports = class MyCustomLogicHook {
constructor (context, caps, globalArgs) {
this.context = context
this.caps = caps
this.globalArgs = globalArgs
}
onMeStart ({ container, args }) {
container.pluginInstance._runInQueue(async () => {
//this is the WebdriverIO browser instance if needed
const browser = container.pluginInstance.browser
const myBtn = await this.findElement('.my-button')
await myBtn.click()
// and here some more WebdriverIO code ...
})
}
}
The _runInQueue is needed to not interfere with other Selenium calls that might happen the same time, like checking for chatbot response