MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / test_iframe_basics

Method test_iframe_basics

examples/iframe_tests.py:7–22  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5
6class FrameTests(BaseCase):
7 def test_iframe_basics(self):
8 self.goto("https://seleniumbase.io/w3schools/iframes.html")
9 self.assert_title("iframe Testing")
10 self.click("button#runbtn")
11 self.switch_to_frame("iframeResult") # Enter the iframe
12 self.assert_text("HTML Iframes", "h2")
13 self.switch_to_frame('[title*="Iframe"]') # Enter iframe inside iframe
14 self.assert_text("This page is displayed in an iframe", "h1")
15 self.switch_to_parent_frame() # Exit only the inner iframe
16 self.assert_text("Use CSS width & height to specify", "p")
17 self.switch_to_frame('[title*="Iframe"]') # Enter iframe inside iframe
18 self.assert_text("seleniumbase.io/w3schools/iframes", "a")
19 self.switch_to_default_content() # Exit all iframes
20 self.click("button#runbtn")
21 self.switch_to_frame("iframeResult") # Go back inside 1st iframe
22 self.highlight('iframe[title="Iframe Example"]')
23
24 def test_iframes_with_context_manager(self):
25 self.goto("https://seleniumbase.io/w3schools/iframes.html")

Callers

nothing calls this directly

Calls 8

gotoMethod · 0.45
assert_titleMethod · 0.45
clickMethod · 0.45
switch_to_frameMethod · 0.45
assert_textMethod · 0.45
highlightMethod · 0.45

Tested by

no test coverage detected