From: Sandy D. <sd...@cs...> - 2006-12-06 16:45:40
|
I also have a need for this type of feature. The application I'm testing has dynamic interfaces (e.g., components show/hide depending on user actions). For now, my solution has been to write my own assert function that catches the exception thrown by Marathon. For example: # Verifies that a component that should be hidden is not visible def assertComponentNotPresent(component_name): from marathon.playback import * # try to get a component that should not be visible try: click(component_name) except net.sourceforge.marathon.component.ComponentNotFoundException: # if the component is not present, catch the exception thrown by # marathon so the test does NOT fail. print('Window component \'' + component_name + '\' is not visible - okay') return # no exception was caught, so the component is visible; fail the test! fail('Window component \'' + component_name + '\' is visible but should not be!') It is probably not good practice to use Marathon exception classes directly, but I don't have a better way to do what I need. Sandy -----Original Message----- From: mar...@li... [mailto:mar...@li...] On Behalf Of Alex Besogonov Sent: Sunday, December 03, 2006 9:51 AM To: mar...@li... Subject: [Marathonman-devel] Feature request: negative asserts I have a small feature request - negative assertions (i.e. assertions which check non-existance of properties, windows, etc.). For example, I have a test where user with administrator access logs into my application and then another administrator user revokes priviledges of the first user and my application immediately disables administrator options for the first user in its UI. Currently, I don't know how to test it with Marathon because I can't assert that there's no component with a particular name. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Marathonman-devel mailing list Mar...@li... https://lists.sourceforge.net/lists/listinfo/marathonman-devel |