File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed
test/sanity/issue5980-aws-sdk-embedded-youtobe-video-crash Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 6
6
< title > issue5980-aws-sdk-embedded-youtobe-vedio-crash</ title >
7
7
</ head >
8
8
< body >
9
- < iframe src ="https://www.youtube.com/embed/C0DPdy98e4c "> </ iframe >
9
+ < iframe src ="https://www.youtube.com/embed/C0DPdy98e4c " id =" iframe_a " > </ iframe >
10
10
</ body >
11
11
</ html >
Original file line number Diff line number Diff line change 27
27
switch_to_app (driver )
28
28
print driver .current_url
29
29
print 'waiting for crash'
30
- wait_for_element_tag (driver , "iframe" )
31
- assert (driver .find_element_by_tag_name ("iframe" ) is not None )
32
- driver .switch_to_frame (driver .find_element_by_tag_name ("iframe" ))
33
- wait_for_element_class (driver , "ytp-large-play-button" )
30
+ wait_for_element_id (driver , "iframe_a" )
31
+ driver .switch_to_frame ("iframe_a" )
32
+ timeout = 10
33
+ while timeout > 0 :
34
+ try :
35
+ ret = driver .find_element_by_class_name ('ytp-large-play-button' )
36
+ break
37
+ except selenium .common .exceptions .NoSuchElementException :
38
+ driver .switch_to_default_content ()
39
+ driver .switch_to_frame ("iframe_a" )
40
+ except selenium .common .exceptions .WebDriverException :
41
+ pass
42
+ time .sleep (1 )
43
+ timeout = timeout - 1
44
+ if timeout <= 0 :
45
+ raise Exception ('Timeout when waiting for element ytp-large-play-button' )
34
46
assert (driver .find_element_by_class_name ("ytp-large-play-button" ) is not None )
35
47
print 'There is no crash'
36
48
finally :
You can’t perform that action at this time.
0 commit comments