File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
test/sanity/additional_trust_anchors Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change 2
2
import os
3
3
import subprocess
4
4
import platform
5
+ import sys
6
+ sys .path .append (os .path .dirname (os .path .dirname (os .path .abspath (__file__ ))))
7
+ from nw_util import *
5
8
6
9
from selenium import webdriver
7
10
from selenium .webdriver .chrome .options import Options
@@ -56,12 +59,24 @@ def write_file(filename, content):
56
59
try :
57
60
try :
58
61
print driver .current_url
59
- driver .switch_to_frame (driver .find_element_by_id ('test-frame' ))
62
+ timeout = 10
63
+ ret = ''
64
+ elem_id = 'result'
65
+ while timeout > 0 :
66
+ try :
67
+ driver .switch_to_frame (driver .find_element_by_tag_name ("iframe" ))
68
+ ret = driver .find_element_by_id (elem_id ).get_attribute ('innerHTML' )
69
+ break
70
+ except selenium .common .exceptions .NoSuchElementException :
71
+ pass
72
+ time .sleep (1 )
73
+ timeout = timeout - 1
74
+ if timeout <= 0 :
75
+ raise Exception ('Timeout when waiting for element' + elem_id )
60
76
title = driver .execute_script ('return document.title' )
61
77
print title
62
- result = driver .find_element_by_id ('result' ).get_attribute ('innerHTML' )
63
- print result
64
- assert ('success' in result )
78
+ print ret
79
+ assert ('success' in ret )
65
80
driver .close ()
66
81
finally :
67
82
driver .quit ()
You can’t perform that action at this time.
0 commit comments