L
L
LordOftheCode2021-08-13 18:06:28
C++ / C#
LordOftheCode, 2021-08-13 18:06:28

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

1 answer(s)
S
sergey, 2021-08-14
@LordOftheCode

use javascript to write in textarea
for example
https://github.com/selenide/selenide/blob/master/s...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question