Testing technology. For overall application testing The Grinder 3 testing framework was used. This is wonderful piece of software makes writing functional and performance tests for web application a breeze. Tests cases are defined in the httpscript_wa_tests.py file and actual requests to perform are defined in the technology specific script files: For example: httpscript_wa_tests.py defines test[16]: headers14 = ( NVPair('Accept', 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'),
NVPair('Accept-Charset', 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'),
NVPair('Accept-Encoding', 'gzip,deflate'),
NVPair('Accept-Language', 'en-us,en;q=0.5'),
NVPair('Referer', 'http://localhost:8080/wa_myfaces/companyCRUD.jsf'),
NVPair('User-Agent', 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6'),
NVPair('Content-Type', 'application/x-www-form-urlencoded'), )
tests[16] = Test(16, 'POST companiesList(search the company)').wrap(request16) Then technology specific test defines what it actually means, so for httpscript-sitemesh.py defines it as: tests[16].POST('http://localhost:8080/wa_sitemesh/do/companiesList',
( NVPair('nameCriteria', 'SSSSS'),
NVPair('actionCMDsearch', 'submit'), )) and httpscript-jsf.py defines it as: tests[16].POST('http://localhost:8080/wa_myfaces/companiesList.jsf',
( NVPair('companiesListFormID:_id3', 'SSSSS'),
NVPair('companiesListFormID:_id4', 'Search'),
NVPair('companiesListFormID_SUBMIT', '1'),
NVPair('autoScroll', '0,0'),
NVPair('companiesListFormID:_link_hidden_', ''), )) Note: The tests do not test returned content (for now, just for clarity - doing it is very easy with TheGrinder). |