Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
checking for Error Dialog Box
#1
Solved: 11 Years, 4 Months ago
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.
#2
Solved: 11 Years, 4 Months ago
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
#3
Solved: 11 Years, 4 Months ago
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.
#4
Solved: 11 Years, 4 Months ago
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).
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
#5
Solved: 11 Years, 4 Months ago
it's worked perfectly.
Thanks Ankur.


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to send/pass UFT Run Error Dialog as output value to main driver script lravi4u 0 583 11-05-2023, 03:55 PM
Last Post: lravi4u
  Automating save dialog box in windows using UFT shipu 0 4,780 01-16-2015, 07:54 PM
Last Post: shipu
  QTP 11 - Chrome 24. Dialog box is identifying as Win object. Kannan R 0 3,087 08-13-2013, 08:10 PM
Last Post: Kannan R
  spell checking of web objects kriday 3 3,975 07-05-2013, 01:37 PM
Last Post: Staff
  css sprited image checking gerfred 0 1,573 01-29-2013, 03:46 PM
Last Post: gerfred

Forum Jump:


Users browsing this thread: 1 Guest(s)