I'm trying to write in a field with text containing emoji on the website
web.whatsapp.com .<br>
My project uses C#, Chromedriver , .Net 5 and Selenium.<br>
Selenium doesn't write emojis in Chromedriver natively, so I need to write using javascript.<br>
I can write with javascript in the field, but when I click again in the field and submit the text, the content I write disappears.<br>
I could write a few days ago, but now I can't.<br>
How to solve this?<br>
Here's the code:<br><br>
try
{
IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
js.ExecuteScript("document.getElementsByClassName('_13NKt copyable-text selectable-text')[0].innerText=arguments[0]", "Hello😁");
driver.FindElement(By.XPath("//*[@id='app']/div/div/div[2]/div[2]/span/div/span/div/div/div[2]/div/div[1]/div[3]/div/div/div[2]/div[1]/div[2]")).SendKeys(" ");
driver.FindElement(By.XPath("//*[@id='app']/div[1]/div[1]/div[2]/div[2]/span/div[1]/span/div[1]/div/div[2]/div/div[1]/div[3]/div/div/div[2]/div[1]/div[2]")).SendKeys(OpenQA.Selenium.Keys.Backspace);
driver.FindElement(By.XPath("//span[@data-testid ='send']")).Click();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}