assertSucks

I wrote this function this afternoon after being frustrated by the lack of decent checkpoints in QuickTest. I hope you find it insightful.

Visual Basic:
  1. Public Function assertSucks ( sString, sEvent )
  2.     Dim sSuckMessage, bSuck, sNot
  3.     sNot = "not"
  4.     bSuck = False
  5.     If sString = "checkpoints" Then
  6.         bSuck = True
  7.         sNot = "indeed"
  8.     End If
  9.  
  10.     sSuckMessage = "Expected Suckitude. " & sString & _
  11.         " does " & sNot & " suck."
  12.     assertSucks = reportStatus( bSuck, sEvent, sSuckMessage )
  13. End Function

Tags: ,

2 Comments for “assertSucks”

  1. Theo Says:

    ROFL!!!! Some of my functions have more…colorful names as well. It’s frustrating to have to replace native “functionality” with your own because the native “tools” do indeed suck….

    Thank you for this…a great laugh to start my day. :-)

    Theo

    Reply to Theo

  2. Dlorde Says:

    Checkpoints? Using QTP on a Java application I never seem to find a use for them - I write my own comparisons & report events in libraries.

    I agree with all you say about QTP 9 - a bit of a curate’s egg, but definitely better than it was.

    Unfortunately, there are a few bugs in the Java add-in, the most annoying of which is that when you test that an object exists (object.Exist), it always waits until the Object Synchronization Timeout expires before continuing… ouch! That leaves you with a test that takes forever, or if you reduce the timeout, a test that takes longer than it should and occasionally times out.

    Another doozy is when Typing to an object, it duplicates the first character. Argh! Had to write a method to insert a backspace into the typed text so it will delete the duplicate…

    How do obvious bugs like these get through their testing? Don’t tell me - they use QTP 9 to test itself? ;-)

    Reply to Dlorde

Leave a Reply