Skip to content

Send text to div in Selenium + Java

I want to send a text to a div element in web.whatsapp. I tried several ways ie using XPath, cssSelector, class name etc. but none is working for me.

Web Whatsapp

This textbox comes when we attach an image in web.whatsapp.



Please step into the div and use the div with the class “selectable-text”. As this is a contenteditable div you should be able to click into it and call then sendKeys() onto the element.

if this does not help please let me know then I will look in our code how we are filling such divs exactly.

User contributions licensed under: CC BY-SA
6 People found this is helpful