O'Reilly logo

Selenium WebDriver Practical Guide by Satya Avasarala

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Handling cookies

Let's say you are automating the Facebook webpage. There could be many scenarios you want to automate, such as writing on your wall, writing on your friend's wall, reading other walls, adding friends, deleting friends, and so on. For all these actions, one common thing is to have to log in to Facebook in each of the test cases. So, logging in to Facebook in every test case of yours will increase the overall test execution time significantly. To reduce the execution time of your test cases, you can actually skip signing in for every test case. This can be done by signing in for one time and writing all the cookies of that domain into a file. From the next login onwards, you can actually load the cookies from the file and add to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required