0
votes

I have an automated testing program, which uses SOAPUI, that is executed using VBScript. However, whenever I execute the testing program a SOAPUI dialog box opens up asking something like "Do you want to help us improve SOAPUI by sending usage statistics." I manually click "No," and the testing program keeps running along.

Is there a way to suppress this dialog box so that it never appears when I run the automated testing program. The VBScript code is below.

Option Explicit

Dim RootFolder, ExecFolder, Command, FSO, Shell

Set FSO = CreateObject("Scripting.FileSystemObject")
Set Shell = CreateObject("WScript.Shell")

RootFolder = FSO.GetParentFolderName(FSO.GetParentFolderName(WScript.ScriptFullName))
ExecFolder = FSO.GetParentFolderName(WScript.ScriptFullName)

On Error Resume Next

'Clean previous log files
Call FSO.DeleteFile(ExecFolder & "\*.txt", True)
Call FSO.DeleteFile(RootFolder & "\Test\*.txt", True)
Call FSO.DeleteFile(ExecFolder & "\*.log", True)

'Execute
Command = Chr(34) & RootFolder & "\SoapUI\bin\testrunner.bat" & Chr(34) & " " & _
          Chr(34) & RootFolder & "\Test\Expando.xml" & Chr(34)

Shell.CurrentDirectory = ExecFolder
Call Shell.Run(Command, 1, True)
1

1 Answers

0
votes

I have resolved this problem by using SendKeys.

OPTION EXPLICIT

Dim RootFolder, ExecFolder, Command, FSO, Shell

Set FSO = CreateObject("Scripting.FileSystemObject")
Set Shell = CreateObject("WScript.Shell")

RootFolder = FSO.GetParentFolderName(FSO.GetParentFolderName(Wscript.ScriptFullName))
ExecFolder = FSO.GetParentFolderName(Wscript.ScriptFullName)

On Error Resume Next

'Clean previous log files
Call FSO.DeleteFile(ExecFolder & "\*.txt", True)
Call FSO.DeleteFile(RootFolder & "\Test\*.txt", True)
Call FSO.DeleteFile(ExecFolder & "\*.log", True)

'Execute
Command = Chr(34) & RootFolder &  "\SoapUI\bin\testrunner.bat" & Chr(34) & " " & Chr(34) & RootFolder & "\Test\Expando.xml" & Chr(34)

Shell.CurrentDirectory = ExecFolder
Call Shell.Run(Command, 1, False)
WScript.Sleep(20000)
Shell.SendKeys("~")