Request: Write cookie option

Bug #1159980 reported by Nicholas Bencriscutto
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
selenium-simple-test
Confirmed
Wishlist
Unassigned

Bug Description

Currently I can get the cookies, but the webpage I am testing if I go back to the /login it deletes the local cookies.
I want to be able to login, grab the cookies then open re open the browser for other parts of my testing framework. If I reopen the browser and hit the webpage again it forces me back to /login... since I already have the cookie I would like a write_cookie function that will write the cookie pending which browser I am using.

Tags: request
Vincent Ladeuil (vila)
Changed in selenium-simple-test:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Corey Goldberg (coreygoldberg) wrote :

this should be easy to add.

selenium has and `add_cookie` method we can use.

----

add_cookie(self, cookie_dict)

Adds a cookie to your current session.

:Args:
 - cookie_dict: A dictionary object, with required keys - "name" and "value";
    optional keys - "path", "domain", "secure", "expiry"

Usage:
    driver.add_cookie({'name' : 'foo', 'value' : 'bar'})
    driver.add_cookie({'name' : 'foo', 'value' : 'bar', 'path' : '/'})
    driver.add_cookie({'name' : 'foo', 'value' : 'bar', 'path' : '/', 'secure':True})

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.