@@ -198,12 +198,12 @@ def get_link_attribute(self, link_text, attribute, hard_fail=True):
198
198
return attribute_value
199
199
if hard_fail :
200
200
raise Exception (
201
- 'Unable to find attribute [%s] from link text [%s] !'
201
+ 'Unable to find attribute {%s} from link text {%s} !'
202
202
% (attribute , link_text ))
203
203
else :
204
204
return None
205
205
if hard_fail :
206
- raise Exception ("Link text [%s] was not found!" % link_text )
206
+ raise Exception ("Link text {%s} was not found!" % link_text )
207
207
else :
208
208
return None
209
209
@@ -214,15 +214,15 @@ def wait_for_link_text_present(self, link_text,
214
214
for x in range (int (timeout * 5 )):
215
215
try :
216
216
if not self .is_link_text_present (link_text ):
217
- raise Exception ("Link text [%s] not found!" % link_text )
217
+ raise Exception ("Link text {%s} not found!" % link_text )
218
218
return
219
219
except Exception :
220
220
now_ms = time .time () * 1000.0
221
221
if now_ms >= stop_ms :
222
222
break
223
223
time .sleep (0.2 )
224
224
raise Exception (
225
- "Link text [%s] was not present after %s seconds!" % (
225
+ "Link text {%s} was not present after %s seconds!" % (
226
226
link_text , timeout ))
227
227
228
228
def click_link_text (self , link_text , timeout = settings .SMALL_TIMEOUT ):
@@ -336,9 +336,9 @@ def click_partial_link_text(self, partial_link_text,
336
336
return
337
337
raise Exception (
338
338
'Could not parse link from partial link_text '
339
- '[%s] ' % partial_link_text )
339
+ '{%s} ' % partial_link_text )
340
340
raise Exception (
341
- "Partial link text [%s] was not found!" % partial_link_text )
341
+ "Partial link text {%s} was not found!" % partial_link_text )
342
342
# Not using phantomjs
343
343
element = self .wait_for_partial_link_text (
344
344
partial_link_text , timeout = timeout )
@@ -405,7 +405,7 @@ def get_attribute(self, selector, attribute, by=By.CSS_SELECTOR,
405
405
if attribute_value is not None :
406
406
return attribute_value
407
407
else :
408
- raise Exception ("Element [%s] has no attribute [%s] !" % (
408
+ raise Exception ("Element {%s} has no attribute {%s} !" % (
409
409
selector , attribute ))
410
410
411
411
def refresh_page (self ):
@@ -960,7 +960,7 @@ def convert_to_css_selector(self, selector, by):
960
960
return 'a:contains("%s")' % selector
961
961
else :
962
962
raise Exception (
963
- "Exception: Could not convert [%s] (by=%s) to CSS_SELECTOR!" % (
963
+ "Exception: Could not convert {%s} (by=%s) to CSS_SELECTOR!" % (
964
964
selector , by ))
965
965
966
966
def set_value (self , selector , new_value , by = By .CSS_SELECTOR ,
@@ -1081,12 +1081,12 @@ def generate_referral(self, start_page, destination_page):
1081
1081
(This generates real traffic for testing analytics software.) """
1082
1082
if not page_utils .is_valid_url (destination_page ):
1083
1083
raise Exception (
1084
- "Exception: destination_page [%s] is not a valid URL!"
1084
+ "Exception: destination_page {%s} is not a valid URL!"
1085
1085
% destination_page )
1086
1086
if start_page :
1087
1087
if not page_utils .is_valid_url (start_page ):
1088
1088
raise Exception (
1089
- "Exception: start_page [%s] is not a valid URL! "
1089
+ "Exception: start_page {%s} is not a valid URL! "
1090
1090
"(Use an empty string or None to start from current page.)"
1091
1091
% start_page )
1092
1092
self .open (start_page )
0 commit comments