Answer the question
In order to leave comments, you need to log in
selenium error when entering text in textarea?
I tried to write a program that enters the instagram site with cookies and writes a comment to the post.
Everything works fine, I click on the textarea (input but there is textarea) the click is counted and when the program starts to enter text the error comes out ( element is not attached to page document )
xpath are written correctly
Code:
driver = new ChromeDriver();
driver.Navigate().GoToUrl("https://www.instagram.com/p/CRmiXY8lkwD/");
driver.Manage().Cookies.AddCookie(new Cookie("sessionid", "48257564335%3AxqVRD0uGeXxIor%3A25"));
driver.Navigate().Refresh();
Thread.Sleep(1500);
var input = driver.FindElement(By.XPath("//textarea[@class='Ypffh']"));
input.Click();
input.SendKeys("test spam");
Thread.Sleep(1200);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question