Skip to content

the keyword "select frame " dose not work well #36

Closed

Description

@lucasliu

The key word 'select frame' can't recoginze iframes which are dynamic genrerated by Ajax.

I tried selenium2 python binding it works fine.

so I checked source code (_browsermanagement.py) and made some change,then, It worked.
I wonder the function of the two lines ( I can't find the realizition of _element_find.)
#element = self._element_find(locator, True, True, tag='frame')
#self._current_browser().switch_to_frame(element)


def select_frame(self, locator):
    """Sets frame identified by `locator` as current frame.

    Key attributes for frames are `id` and `name.` See `introduction` for
    details about locating elements.
    """
    self._info("Selecting frame '%s'." % locator)
    #element = self._element_find(locator, True, True, tag='frame')
    #self._current_browser().switch_to_frame(element)
    self._current_browser().switch_to_frame(locator)

Activity

  1. poliarush commented on Mar 3, 2012

    @poliarush

    I also faced the same situation.
    The issue is in

    element = self._element_find(locator, True, True, tag='frame')

    in tag='frame'

    because in class ElementFinder no logic to handle frame tag

    def _get_tag_and_constraints(self, tag):
    if tag is None: return None, {}

        tag = tag.lower()
        constraints = {}
        if tag == 'link':
            tag = 'a'
        elif tag == 'image':
            tag = 'img'
        elif tag == 'list':
            tag = 'select'
        elif tag == 'radio button':
            tag = 'input'
            constraints['type'] = 'radio'
        elif tag == 'checkbox':
            tag = 'input'
            constraints['type'] = 'checkbox'
        elif tag == 'text field':
            tag = 'input'
            constraints['type'] = 'text'
        elif tag == 'file upload':
            tag = 'input'
            constraints['type'] = 'file'
        return tag, constraints
    

    Therefore need to hack code to make it work, like this

    element = self._element_find(locator, True, True)

  2. adwu73 commented on Mar 10, 2012

    @adwu73
    Contributor

    Please see the fix in issue 21 for this iframe issue

  3. emanlove commented on Jun 30, 2012

    @emanlove
    Member

    @lucasliu @Polusok @adwu73 : This issue has been fixed in #71.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions