frame
The command to switch the driver's context to the frame given its name or id.
Syntax
py.switch_to.frame(name_or_id: str, timeout: int = 0) -> PyleniumUsage
# switch to an iframe with name of 'main-content'
py.switch_to.frame("main-content")
---or--- # chain a Pylenium command
py.switch_to.frame("main-content").contains("Add New").click()Arguments
name_or_id (str)- The name or id attribute value of the<frame>elementtimeout=0 (int)- The number of seconds to wait for the frame to be switched to
Yields
Pylenium - The current instance of Pylenium so you can chain commands
Examples
If we wanted to click the link above, we would need to:
Switch the driver's context to the iframe
Then perform the click
This is a piece of cake with Pylenium:
Last updated