I am in trouble and I hope one of you can help
I am building the test in Python but the language does not matter much.
here is my problem.
I run my test and sometime a window pops up that states "System Buzy, Please try again"
if this window is displayed then I need to run most of the test again, if it's not displayed then the test is complete and I only need to run my exit commands.
So how do I test for a window and not fail ?
can I somehow select the window and have it be more of an if then a fail ?
because as I said, if the window is not shown then the test passed.
have you tried the select_window method?
you can specify the new window by title, internal javascript name, or javascript variable
Hi,
If it is HTML Popup Window, you can use selectWindow Method.
I don't think it will be HTML window. It may be Javascript popup window(Like JS Alert or JS Confirmation)
If it is JS Alert or JS Confirmation, you can use isAlertPresent or isConfirmationPresent
Regards,
Rajasekhar.
I resolved this last week.
I finally had more then 15 minutes at one time to work this out and it dd work about the way I wanted it to.
here is the Python code assocated. .... is the complete test on the page that I need to loop back thru.
for count in range(5):
.......
# check for message board window by seeling all windows.
windowArray = sel.get_all_window_names()
Window_name = u"Window_Name"
if windowArray[1] == Window_name:
print "System Busy try test again"
sel.select_window("Window_Name")
for i in range(60):
try:
if sel.is_element_present("B1"): break
except: pass
else: self.fail("time out")
try: self.failUnless(sel.is_text_present("ERROR!!! ... System is busy, please try again in a few seconds"))
except AssertionError, e: self.verificationErrors.append(str(e))
sel.click("B1")
sel.select_window("")
time.sleep(10 * count)
else:
print "System was not busy"
break
print count
#end loop here
if count == 4:
self.fail("ran 5 times and it was buzy")
time.sleep(1)
