Skip to content

Cannot add keywords #79

Closed
Closed

Description

@hbmartin

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?

Activity

  1. hbmartin commented on Jul 17, 2012

    @hbmartin
    Author

    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=/")

  2. j1z0 commented on Jul 18, 2012

    @j1z0
    Contributor

    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

  3. hbmartin commented on Jul 19, 2012

    @hbmartin
    Author

    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?

  4. hbmartin commented on Jul 19, 2012

    @hbmartin
    Author

    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'

  5. hbmartin commented on Jul 19, 2012

    @hbmartin
    Author

    I'm an idiot... should be using the add_cookie method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions