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
{{ message }}
Repository navigation
the keyword "select frame " dose not work well #36
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)
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
Activity
poliarush commentedon Mar 3, 2012
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, {}
Therefore need to hack code to make it work, like this
element = self._element_find(locator, True, True)
adwu73 commentedon Mar 10, 2012
Please see the fix in issue 21 for this iframe issue
emanlove commentedon Jun 30, 2012
@lucasliu @Polusok @adwu73 : This issue has been fixed in #71.