Cookies, or HTTP cookies, are pieces of data stored on the user’s computer containing information about the user and the user’s preference on a specific website. For example, a cookie can store the authentication information of the user or session information such as browsing history, so the website can improve the user’s experience based on their preferences.
In this article, we’ll see the commands used for working with cookies in Selenium.
Why we need to work with cookies in Selenium 🍪
One of the good practices in test automation states that each test should focus on only one functionality. This means that we don’t want our tests to perform too many actions through the UI before we get to the actual condition we want to verify. Let’s look at an example: you’re trying to test items added to the cart that can be ordered in an e-commerce application. But to finalize the purchase, you…