Save cookies to Selenium

Asked

Viewed 273 times

1

I’m developing an automation in Selenium C# to log in to Facebook and do some operations, but every login asks me to account verification.

There is a way you can save authentications as a common browser for each time you run no longer ask?

        public void Login(ref ModelSession<Browser> refLoginSession, ModelSession<Browser> session)
        {
            var browser = session.Session.Driver;

            string usuario = "emailusuario";
            string senha = "senha";

            browser.Url = "https://www.intern.facebook.com/help/contact/290640558131181";
            browser.FindElement(By.Id("email")).SendKeys(usuario);
            browser.FindElement(By.Id("pass")).SendKeys(senha);
            browser.FindElement(By.Id("loginbutton")).ClickJs();
         }
  • 1

    May be useful: https://www.guru99.com/handling-cookies-selenium-webdriver.html

  • ta using that browser?

  • @Tmilitino Chrome man

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.