@contextmanager<EOL><INDENT>def frame(self, locator=None, *args, **kwargs):<DEDENT>
self.switch_to_frame(self._find_frame(locator, *args, **kwargs))<EOL>try:<EOL><INDENT>yield<EOL><DEDENT>finally:<EOL><INDENT>self.switch_to_frame("<STR_LIT>")<EOL><DEDENT>
Execute the wrapped code within the given iframe using the given frame or frame name/id.
May not be supported by all drivers.

Args:
    locator (str | Element, optional): The name/id of the frame or the frame's element.
        Defaults to the only frame in the document.