Issues while receiving conversations from Whatsapp

Hi Florian
Requirement :
Handling Texts, buttons and media files from Whatsapp chatbot responses using Botium.

Issue :
We are facing the following issues while working with Whatspp chatbot.

  1. Botium is unable to receive Buttons or other media files from Whatspp when we use WebDriver script = “Whatsapp”, I think the reason is " WEBDRIVERIO_OUTPUT_ELEMENT_HASH" has value “TEXT” in the botium whatsapp connector - botium-connector-webdriverio/profiles/whatsapp.js at master · codeforequity-at/botium-connector-webdriverio · GitHub
    Also Botium doesn’t receive DUPLICATE response from whatsapp chatbot while " WEBDRIVERIO_OUTPUT_ELEMENT_HASH" =“TEXT”.

  2. 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.

Please find the attachments below.







Thanks & regards
Prasanth Kandasamy

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.

1 Like

Florian, when we use TEXT as the hash, then Botium ignores duplicate responses from the chatbot, is there a way to overcome this issue ?

BR
Prasanth Kandasamy

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.

1 Like

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")]'

Thanks & regards
Prasanth Kandasamy

Makes sense, added this to our backlog.

Part of the next release