@@ -198,12 +198,12 @@ def get_link_attribute(self, link_text, attribute, hard_fail=True):
198198 return attribute_value
199199 if hard_fail :
200200 raise Exception (
201- 'Unable to find attribute [%s] from link text [%s] !'
201+ 'Unable to find attribute {%s} from link text {%s} !'
202202 % (attribute , link_text ))
203203 else :
204204 return None
205205 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 )
207207 else :
208208 return None
209209
@@ -214,15 +214,15 @@ def wait_for_link_text_present(self, link_text,
214214 for x in range (int (timeout * 5 )):
215215 try :
216216 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 )
218218 return
219219 except Exception :
220220 now_ms = time .time () * 1000.0
221221 if now_ms >= stop_ms :
222222 break
223223 time .sleep (0.2 )
224224 raise Exception (
225- "Link text [%s] was not present after %s seconds!" % (
225+ "Link text {%s} was not present after %s seconds!" % (
226226 link_text , timeout ))
227227
228228 def click_link_text (self , link_text , timeout = settings .SMALL_TIMEOUT ):
@@ -336,9 +336,9 @@ def click_partial_link_text(self, partial_link_text,
336336 return
337337 raise Exception (
338338 'Could not parse link from partial link_text '
339- '[%s] ' % partial_link_text )
339+ '{%s} ' % partial_link_text )
340340 raise Exception (
341- "Partial link text [%s] was not found!" % partial_link_text )
341+ "Partial link text {%s} was not found!" % partial_link_text )
342342 # Not using phantomjs
343343 element = self .wait_for_partial_link_text (
344344 partial_link_text , timeout = timeout )
@@ -405,7 +405,7 @@ def get_attribute(self, selector, attribute, by=By.CSS_SELECTOR,
405405 if attribute_value is not None :
406406 return attribute_value
407407 else :
408- raise Exception ("Element [%s] has no attribute [%s] !" % (
408+ raise Exception ("Element {%s} has no attribute {%s} !" % (
409409 selector , attribute ))
410410
411411 def refresh_page (self ):
@@ -960,7 +960,7 @@ def convert_to_css_selector(self, selector, by):
960960 return 'a:contains("%s")' % selector
961961 else :
962962 raise Exception (
963- "Exception: Could not convert [%s] (by=%s) to CSS_SELECTOR!" % (
963+ "Exception: Could not convert {%s} (by=%s) to CSS_SELECTOR!" % (
964964 selector , by ))
965965
966966 def set_value (self , selector , new_value , by = By .CSS_SELECTOR ,
@@ -1081,12 +1081,12 @@ def generate_referral(self, start_page, destination_page):
10811081 (This generates real traffic for testing analytics software.) """
10821082 if not page_utils .is_valid_url (destination_page ):
10831083 raise Exception (
1084- "Exception: destination_page [%s] is not a valid URL!"
1084+ "Exception: destination_page {%s} is not a valid URL!"
10851085 % destination_page )
10861086 if start_page :
10871087 if not page_utils .is_valid_url (start_page ):
10881088 raise Exception (
1089- "Exception: start_page [%s] is not a valid URL! "
1089+ "Exception: start_page {%s} is not a valid URL! "
10901090 "(Use an empty string or None to start from current page.)"
10911091 % start_page )
10921092 self .open (start_page )
0 commit comments