Tuesday

When message box is not sufficient!!




There are instances when we want to output a large amount of text and we can see just the truncated version in a msgbox. Here is a quick function that can be reused:

Sub Debug2(myText)
  ' Uncomment the next line to turn off debugging
  ' Exit Sub

  If Not IsObject(objIEDebugWindow) Then
    Set objIEDebugWindow = CreateObject("InternetExplorer.Application")
    objIEDebugWindow.Navigate "about:blank"
    objIEDebugWindow.Visible = True
    objIEDebugWindow.Toolbar = False
    objIEDebugWindow.Width = 200
    objIEDebugWindow.Height = 300
    objIEDebugWindow.Left = 10
    objIEDebugWindow.Top = 10
    Do While objIEDebugWindow.Busy
      WScript.Sleep 100
    Loop
    objIEDebugWindow.Document.Title = "IE Debug Window"
    objIEDebugWindow.Document.Body.InnerHTML = _
                 "" & Now & "
"
  End If

  objIEDebugWindow.Document.Body.InnerHTML = _
                   objIEDebugWindow.Document.Body.InnerHTML _
                   & myText & "
" & vbCrLf
End Sub

Monday

Add a Delay without using sleep / wait



Lets see a simple code snippet that will add some delay without using the native wait or sleep methods while coding using VBs/QTP/QC

Sub Delay( seconds )
    Dim wshShell
    Set wshShell = CreateObject( "WScript.Shell" )
    wshShell.Run "ping -n " & ( seconds + 1 ) & " 127.0.0.1", 0, True
    Set wshShell = Nothing
End Sub


Happy Coding!

Thursday

Signs That You’re Dating A Tester




  • Your love letters get returned to you marked up with red ink, highlighting your grammar and spelling mistakes.
  •  When you tell him that you won’t change something he has asked you to change, he’ll offer to allow you two other flaws in exchange for correcting this one.
  •  When you ask him how you look in a dress, he’ll actually tell you.
  •  When you give him the “It’s not you, it’s me” breakup line, he’ll agree with you and give the specifics.
  •  He won’t help you change a broken light bulb because his job is simply to report and not to fix.
  • He’ll keep bringing up old problems that you’ve since resolved just to make sure that they’re truly gone.