-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
enhancementMaking things betterMaking things better
Description
Add a Context Manager method for switching into iframes using a with
statement.
While inside the with
block, the browser should be within the iframe control.
Here's an example test that should demonstrate this feature:
from seleniumbase import BaseCase
class FrameTests(BaseCase):
def test_iframes_with_context_manager(self):
self.open("https://seleniumbase.io/w3schools/iframes.html")
with self.frame_switch("iframeResult"):
self.assert_text("HTML Iframes", "h2")
with self.frame_switch('[title*="Iframe"]'):
self.assert_text("This page is displayed in an iframe", "h1")
self.assert_text("Use CSS width & height to specify", "p")
with self.frame_switch('[title*="Iframe"]'):
self.assert_text("seleniumbase.io/w3schools/iframes", "a")
self.click("button#runbtn")
with self.frame_switch("iframeResult"):
self.highlight('iframe[title="Iframe Example"]')
(Based on #1407)
Metadata
Metadata
Assignees
Labels
enhancementMaking things betterMaking things better