Any site can have single or multiple cookies. If you know cookie name then you can get it's detail easily using getCookieNamed(). But if there are multiple cookies and you need all of them then you need to use getCookies(). It will retrieve all cookies of site you are navigating in selenium webdriver test. Here we will learn how to get all cookies using getCookies() and extracting all cookie detail using Java Set interface and Iterate through cookie set using Iterator.
A blog on Selenium tutorial, Selenium webdriver tutorial, Selenium IDE tutorial, Appium Tutorial, Selenium Grid Tutorial, Jmeter Tutorial.
How to use addCookie() and getCookieNamed() in Selenium WebDriver
Most of all you are already aware about browser cookie. Basically cookie is piece of data that is stored in your browser. It is sent from website you visit and mostly it is used to recognize if user return to website again. In sort, It tracks your website navigation journey. Cookie consist of different parameters like name, value, expiry, path, etc. Here we will see how can we add cookie and get cookie from browser in selenium webdriver using addCookie() and getCookieNamed().
Related Articles :
selenium,
Selenium 2,
selenium tutorial,
selenium webdriver,
selenium webdriver tutorial,
webdriver tutorials
How to Manage Browser Dimension and Position in Selenium Webdriver
Sometimes you need to set Dimension and Position of your browser window. Webdriver have built in Dimension and Position class with many different methods. We can use both these class and it's methods to set dimensions and positions of browser window. Let's see how we can use Dimension and Position methods to manage size and position
Related Articles :
Selenium 2,
selenium tutorial,
selenium webdriver,
selenium webdriver tutorial,
webdriver tutorials
Subscribe to:
Posts (Atom)