Keep in mind there can be several browsers/webdrivers open, but you can access the active one like this:
below is some working code to workaround the iframe issue without patching until the next release:
from Selenium2Library import Selenium2Library
from robot.libraries.BuiltIn import BuiltIn
def select_iframe(locator):
"""Sets iframe identified by `locator` as current frame.
This is a temporary workaround until Selenium2Library is
patched. Key attributes for frames are `id` and `name.`
See `introduction` for details about locating elements.
"""
seleniumlib = _get_instance()
seleniumlib._info("Selecting iframe '%s'." % locator)
element = seleniumlib._element_find(locator, True, True, tag='iframe')
seleniumlib._current_browser().switch_to_frame(element)
def _get_instance():
return BuiltIn().get_library_instance('Selenium2Library')