if - Jython - Windows

wannaknow jiman13 at gmail.com
Fri Jun 29 05:46:49 EDT 2007


Hi all,

I am using an open source testing framework called Marathon that
uses Jython and i am trying to create a test that will:
- click a menu item
- select Login from the list
- a new window will popup
- insert username and password
- click OK

-*-*- at this point if the login was successful there is no message
to be displayed. If the login was unsuccessful though a popup
window pops up and displays some info about the login-error and an OK
button.
What i want to do is check whether there was an error window or not
and display a simple successful/unsuccessful message. Whats
happening though is that if the login was successful (meaning that the
pop-up window will not open), Marathon is waiting for the error
window,
stops and does not continue with ELIF or ELSE!

This Is The Test Code, any help would be greatly appreciated:


if window('Desktop'):
     click('login')
     select_menu('Login ...')

     if window('Please Login'):
          select('TextField', 'username')
          select('PasswordField', 'password')
          click('Ok')

          if window('Recent Error(s)'):
               click('OK')
               print "\n\nError Detected: Login Failed...\n\n"
          else:
               print "\n\nSuccessfull Login...\n\n"
          close()

     close()

close()




More information about the Python-list mailing list