Answer the question
In order to leave comments, you need to log in
How to launch a browser with cookies attached using Selenium WebDriver?
Hello, please tell me how to launch a browser with ready-made cookies that are stored on the disk? That is, I want Selenium to not just launch a pristine browser, but use the cookie file that I already have. And, if someone knows, is it possible to simulate driving with a mouse using this WebDriver?
Answer the question
In order to leave comments, you need to log in
You can move the mouse, (for) press the buttons using the builder:
Actions builder = new Actions(driver);
builder.keyDown(Keys.CONTROL)
.click(someElement)
.moveByOffset( 10, 25 );
.click(someOtherElement)
.keyUp(Keys.CONTROL).build().perform();
Cookie cookie1 = new Cookie("key1", "value1");
driver.manage().addCookie(cookie1);
Cookie cookie2 = new Cookie("key2", "value2");
driver.manage().addCookie(cookie2);
And how can you change the Yandex control line in cookies, can you tell me? So that Yandex perceives the appeal not as from an empty account, but as if there is already a history of requests in the past?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question