File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change
1
+ from seleniumbase import BaseCase
2
+
3
+
4
+ class FrameTests (BaseCase ):
5
+ def test_iframe_basics (self ):
6
+ self .open (
7
+ "https://www.w3schools.com/html/tryit.asp"
8
+ "?filename=tryhtml_iframe_height_width_css"
9
+ )
10
+ self .ad_block () # Reduce noise during automation
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_default_content () # Exit all iFrames
16
+ self .switch_to_frame ("iframeResult" ) # Go back inside 1st iFrame
17
+ self .highlight ('iframe[title="Iframe Example"]' )
18
+
19
+ def test_set_content_to_frame (self ):
20
+ self .open (
21
+ "https://www.w3schools.com/html/tryit.asp"
22
+ "?filename=tryhtml_iframe_height_width_css"
23
+ )
24
+ self .set_content_to_frame ("iframeResult" )
25
+ self .highlight ('iframe[title="Iframe Example"]' , loops = 8 )
Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ def test_file_upload_button(self):
10
10
"https://www.w3schools.com/jsref/tryit.asp"
11
11
"?filename=tryjsref_fileupload_get"
12
12
)
13
- self .ad_block ()
14
- self .switch_to_frame ("iframeResult" )
13
+ self .set_content_to_frame ("iframeResult" )
15
14
zoom_in = 'input[type="file"]{zoom: 1.6;-moz-transform: scale(1.6);}'
16
15
self .add_css_style (zoom_in )
17
16
self .highlight ('input[type="file"]' )
You can’t perform that action at this time.
0 commit comments