VBscript to close any popup message box

A strange thing happened when i was trying to run QTP tests from Quality Center , there was this error message popped up after every test run.
Until the message box was not closed manually QC would wait indefinitely, defeating the whole purpose of automation.



So here is the vbcript that would run indefinitely waiting for the popup; and close it for tests to continue:

Set wshShell = CreateObject("WScript.Shell")
Do
      ret = wshShell.AppActivate("System Settings Change")
      If ret = True Then
          wshShell.SendKeys "%N"
          Exit Do
      End If
      WScript.Sleep 500
  Loop 

Comments

Popular posts from this blog

XPATH for IE / internet explorer

All time good software testing books!