To overcome the above issues we started using WebDriver script = “Custom Selenium Scripts and Selectors” but when we use WEBDRIVERIO_OUTPUT_ELEMENT_HASH" =“INDEX”, the conversation gets stuck after receiving 8 to 10 responses from the chatbot. Is there any such limitations while using WEBDRIVERIO_OUTPUT_ELEMENT_HASH" =“INDEX”?
We are not able to use WEBDRIVERIO_OUTPUT_ELEMENT_HASH = ELEMENTID or HASH , when we do so, botium tries calls .getHTML method and there is no HTML linked to the elements in Whatsapp.
Reading buttons and media files from Whatsapp chatbot responses is currently not implemented.
Using INDEX as hash does not work here: When scrolling down in a Whatsapp chat, the invisible parts of the chat are removed from the output tree and not accessible to Appium anymore. The INDEX hash can only be used for user interfaces that keep the full output DOM tree and do not manipulate the history.
I havent found anything working except using the TEXT as the hash in Whatsapp, as there obviously are no other element identifiers.
No, because TEXT is exactly that, it ignores duplicate responses. Of course, this is a big issue, but currently it cannot be solved (or better to say, I am lacking the knowledge). But at least it can be used to test simple 2-step conversations (questions + answer), there the duplication won’t be an issue.
Florian, could you please check if you can expose capabilities “WEBDRIVERIO_OUTPUT_ELEMENT” & “WEBDRIVERIO_OUTPUT_ELEMENT_TEXT” of Whatsapp Webdriver to its Botium.json so that we can modify it from TestProjects → Additional capabilities ? The existing xpaths sometimes captures both input request and output response from the Chatbot.
WEBDRIVERIO_OUTPUT_ELEMENT: '//*[(@resource-id="com.whatsapp:id/conversation_text_row" or @resource-id="com.whatsapp:id/text_and_date") and not(descendant::*[@resource-id="com.whatsapp:id/status"])]',
WEBDRIVERIO_OUTPUT_ELEMENT_TEXT: './/*[(@resource-id="com.whatsapp:id/message_text" or @resource-id="com.whatsapp:id/caption")]'