1,072
edits
| (4 intermediate revisions by the same user not shown) | |||
| Line 15: | Line 15: | ||
=== verifyTextNotPresent(str, sel) === | === verifyTextNotPresent(str, sel) === | ||
Looks for | Looks for text on the web-page | ||
* ''str'' - text to look for | * ''str'' - text to look for | ||
* ''sel'' - selenium instance | * ''sel'' - selenium instance | ||
* Returns True if ''str'' is not found else False | * Returns True if ''str'' is not found else False | ||
=== verifyPageTitle(title_regexp, actual_title, sel) === | === verifyPageTitle(title_regexp, actual_title, sel) === | ||
Verify a page title with a regular expression | |||
* ''title_regexp'' - regular expression used in match | * ''title_regexp'' - regular expression used in match | ||
* ''actual_title'' - text used in match | * ''actual_title'' - text used in match | ||
| Line 42: | Line 43: | ||
Converts non-printable characters | Converts non-printable characters | ||
* ''inText'' - input text | * ''inText'' - input text | ||
* Returns ''inText'' with any non-printable characters replaced with character code | * Returns ''inText'' with any non-printable characters replaced with their character code, in the format #d; where d is the character code. | ||
* uses inText.encode('ascii', 'xmlcharrefreplace') to convert | |||
=== equalURL(URL1, URL2) === | |||
Return True if two URLs are functionally equal | |||
* converts special characters to character code found in URLs (ex: space => %20) before testing if they are equal. | |||
== Exception Handling == | |||
=== saveException(exceptionKey, exceptionMsg, exceptionList, exceptionCounts) === | |||
Saves exception messages into exception list and exception type count | |||
* ''exceptionKey'' - type of exception. used as is a key into ''exceptionCounts'' dictionary | |||
* ''exceptionMsg'' - information about the particular exception, such as values and testcase breadcrumb | |||
* ''exceptionList'' - list of exceptions, assumed to be of type list. ''exceptionKey'' and ''exceptionMsg'' are concatenated together and appended to the list. | |||
* ''exceptionCounts'' - count of exception types, assumed to be a dictionary. the entry with a key of ''exceptionKey'' is incremented by 1. if an entry with the key does not exist, an entry is created as initialized to 1. | |||
=== fatalException(exceptionKey, exceptionMsg, exceptionList, exceptionCounts) === | |||
Handle fatal exception | |||
* Calls saveException(). Prints last exception. Ends program by raising AssertionError. | |||
edits