Micro Focus QTP (UFT) Forums
checking for Error Dialog Box - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: checking for Error Dialog Box (/Thread-checking-for-Error-Dialog-Box)



checking for Error Dialog Box - vramu1 - 01-22-2008

Hi,

I’m working on a finance application. For negative testing I need to pass an invalid date. When I’m passing the invalid date, an Error Dialog Box must popup and I need to close the dialog box and fail the test and continue with next set of test.

I’m checking for Error Dialog Box like this

Code:
Sub Sub pickNcompareValues(objExcel ,intRow,ValuesAddRow)
      If [color=#0000FF]SwfWindow("SuperfitsToolset").Dialog("Error").Exist [/color] Then
    ErrDialogBoxText = SwfWindow("SuperfitsToolset").Dialog("Error").GetVisibleText
          TestStatus = "Fail"
       Exit Sub
       End if
'some
'more
'statements
End Sub

When I’m checking for dialog box in each test run
If Error Dialog Box exists, test run completing very quickly
If Error Dialog Box doesn’t exist, test run taking around 25 seconds to complete (I think it's checking for entire screen)

I’m doing any thing wrong? Is there any other way to check for Error Dialog Box?

Regards
Ram.


RE: checking for Error Dialog Box - Rajashekar Gouda - 01-22-2008

Ram,

Since u r calling the function while executing the script, it will rearch for the pop up.If the pop up exists then i will close the error Dialog Box, if Dialog Box not exist then it search for the box for some time, so it is taking 25 sec to move to next page.

I guess it is right.

Regards
Raj


RE: checking for Error Dialog Box - vramu1 - 01-22-2008

Raj,

That's right. I have around 30 values of the different test data to check that perticular page that means It has to run 30 times. so, if it delay by 25 seconds in each test run, total test takes around 15 mins to complete. As I'm new to QTP, I'm not really sure 15 mins is a reasonable time to complete one set of test data.
Is there any other way to bring down the delay/checking time to check the dialog box?

Regards
Ram.


RE: checking for Error Dialog Box - Ankur - 01-23-2008

Just before If statement you can use

Setting("DefaultTimeout") = 1000 where 1000 is in milliseconds.

this will make the default timeout for the object to the no you have specified (in italics).


RE: checking for Error Dialog Box - vramu1 - 01-24-2008

it's worked perfectly.
Thanks Ankur.