If cookies are not stored, you will need to perform login action every time before you execute above listed test scenarios. When Testing a web application using selenium web driver, you may need to create, update or delete a cookie.įor example, when automating Online Shopping Application, you many need to automate test scenarios like place order, View Cart, Payment Information, order confirmation, etc. In order to validate a client, a server parses all of these values in a cookie. In Selenium Webdriver, we can query and interact with cookies with below built-in method: driver.manage().getCookies() // Return The List of all Cookiesĭriver.manage().getCookieNamed(arg0) //Return specific cookie according to nameĭriver.manage().addCookie(arg0) //Create and add the cookieĭriver.manage().deleteCookie(arg0) // Delete specific cookieĭriver.manage().deleteCookieNamed(arg0) // Delete specific cookie according Nameĭriver.manage().deleteAllCookies() // Delete all cookiesĮach cookie is associated with a name, value, domain, path, expiry, and the status of whether it is secure or not.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |