You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to add a create_cookie keyword in keywords/_cookie.py, but Robot Framework doesn't recognize the new keyword. What do I need to do to get new keywords working?
In particular, I added the following lines to _cookie.py:
def create_cookie(self):
"""Creates a demo cookie."""
self._current_browser().create_cookie("test=iWorked", "path=/")
RF is now recognizing the keyword (at least, it's successfully pulling the doc string), but it is saying that there is no create_cookie method. This doesn't make sense to me, since my new keyword is using the same object as all of the other cookie keywords.
KEYWORD: Selenium2Library.Create Cookie Expand All
Documentation: Creates a demo cookie.
Start / End / Elapsed: 20120719 15:33:16.357 / 20120719 15:33:21.058 / 00:00:04.701
FAIL AttributeError: 'WebDriver' object has no attribute 'create_cookie'
Activity
hbmartin commentedon Jul 17, 2012
In particular, I added the following lines to _cookie.py:
def create_cookie(self):
"""Creates a demo cookie."""
self._current_browser().create_cookie("test=iWorked", "path=/")
j1z0 commentedon Jul 18, 2012
That is correct. But to be clear you need to add that function to the _CookieKeywords class right. once you have done that you should be good to go.
Cheers,
Jeremy
hbmartin commentedon Jul 19, 2012
Yes, I added it to the _CookieKeywords class but it still is not available as a keyword in RF.
Perhaps I need to recompile or relink something?
hbmartin commentedon Jul 19, 2012
RF is now recognizing the keyword (at least, it's successfully pulling the doc string), but it is saying that there is no create_cookie method. This doesn't make sense to me, since my new keyword is using the same object as all of the other cookie keywords.
KEYWORD: Selenium2Library.Create Cookie Expand All
Documentation: Creates a demo cookie.
Start / End / Elapsed: 20120719 15:33:16.357 / 20120719 15:33:21.058 / 00:00:04.701
FAIL AttributeError: 'WebDriver' object has no attribute 'create_cookie'
hbmartin commentedon Jul 19, 2012
I'm an idiot... should be using the add_cookie method.