QA/Execution/Web Testing/Selenium Python: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 93: Line 93:
*'''verifyXYZ( ) IDE commands''' are generally converted to [http://docs.python.org/library/unittest.html?highlight=unittest#testcase-objects failUnless, failIf or assertEqual] functions that incorporate a get_XYZ function to retrieve the text, attribute, location, etc, and compare it to the pattern parameter in the IDE command.
*'''verifyXYZ( ) IDE commands''' are generally converted to [http://docs.python.org/library/unittest.html?highlight=unittest#testcase-objects failUnless, failIf or assertEqual] functions that incorporate a get_XYZ function to retrieve the text, attribute, location, etc, and compare it to the pattern parameter in the IDE command.
<blockquote>
<blockquote>
*the Python statement may not have the same verification functionality as the IDE command since the IDE pattern parameter is converted without parsing the prefix (ex: regexpi: ).&nbsp; The Python module for regular expressions is named [http://docs.python.org/library/re.html?highlight=regular%20expressions#module-contents re].
*the Python statement may not have the same verification functionality as the IDE command since the IDE pattern parameter is converted without parsing the prefix (ex: regexpi: ).&nbsp; The Python module for regular expressions is named [http://docs.python.org/library/re.html?highlight=regular%20expressions#module-contents re].  
*changing the failXYZ calls to assertABC could make the script easier to read.  
*changing the failXYZ calls to assertABC could make the script easier to read.
</blockquote>
</blockquote>  
*'''Verification errors''' are stored in a list and dumped at the end of the script. &nbsp;Specificlly:
*'''Verification error reporting''', from converted verifyXYZ IDE commands, are stored in a list and dumped at the end of the script. &nbsp;Specifically:
<blockquote>
<blockquote>the assert or fail function is encompassed in a ''try-except'' statement.&nbsp; The ''except'' part appends the error message into the list verificationErrors.  
the assert or fail function is encompassed in a ''try-except'' statement.&nbsp; The ''except'' part appends the error message into the list verificationErrors.
*the error text it either null or a simple "''value1''&nbsp;!= ''value2''".&nbsp; TBD: other information to include to make the message useful.  
*the error text it either null or a simple "''value1'' != ''value2''".&nbsp; TBD:&nbsp;what other information should be included to make the message useful.
*in the tearDown function, automatically called when the script is finished, if verificationsErrors list is not null the Python traceback is called and the list is dumped. TBD:&nbsp;whether the script should print the verifcation errors for the runtime environment to process.<br>
*in the tearDown function, automated called when the script is finished, if verificationsErrors list is not null the Python trackback is called and the list is dumped.
*
</blockquote>
</blockquote> <blockquote></blockquote>
 
<blockquote></blockquote>
1,072

edits

Navigation menu