def METHOD_NAME(self, locator: Union[WebElement, str]):
    """Sets frame identified by ``locator`` as the current frame.
    See the `Locating elements` section for details about the locator
    syntax.
    Works both with frames and iframes. Use `Unselect Frame` to cancel
    the frame selection and return to the main frame.
    Example:
    | `Select Frame`   | top-frame | # Select frame with id or name 'top-frame'   |
    | `Click Link`     | example   | # Click link 'example' in the selected frame |
    | `Unselect Frame` |           | # Back to main frame.                        |
    | `Select Frame`   | //iframe[@name='xxx'] | # Select frame using xpath       |
    """
    self.info(f"Selecting frame '{locator}'.")
    element = self.find_element(locator)
    self.driver.switch_to.frame(element)