sub main
Set objShell = CreateObject("Wscript.Shell")
call Aliases.MedDispense_UI.frmMainMenu_G5.pnlMain.pnlMainMenu.pnlMenu1.cmdNewPatient.ClickButton
call Aliases.MedDispense_UI.frmPatMaint_G5.pnlMain.WinFormsObject("pnlPatientInfo").WinFormsObject("pnlGeneralInfo").WinFormsObject("pnlRequiredPatInfo").WinFormsObject("txtMedRec").Focus
Sys.Desktop.Keys("cai")
objShell.SendKeys("{ENTER}")
Sys.Desktop.Keys("12we45qwe67")
call Aliases.MedDispense_UI.frmPatMaint_G5.pnlMain.pnlControl.cmdFatherExit.ClickButton
call Aliases.MedDispense_UI.MDMessageDialog_G5.pnlContent.panel1.cmdYES.ClickButton
Call Objects.pnlContent1.Check(Aliases.MedDispense_UI.MDMessageDialog_G5.pnlContent)
call Aliases.MedDispense_UI.MDMessageDialog_G5.pnlContent.panel1.cmdYes.ClickButton
Aliases.MedDispense_UI.frmPatMaint_G5.pnlMain.pnlControl.WinFormsObject("cmdMainMenu").ClickButton
end sub
above is the script i intend to run
Option Explicit
Dim sInstFile
Dim xmlDirectory
Dim fileStartLocation
Dim loginFile
Dim fso
Dim objShell
Dim uninstallFile
Dim installFile
Dim programName
Dim serviceName
Dim startServiceFile
Dim stopServiceFile
dim processName
Set fso = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
xmlDirectory = "C:\Users\clement.cai\Desktop\Vbsedit\VBSformal\cofiguration.xml"
sInstFile = GetTags("publicVBScript", xmlDirectory)&"\PublicVBScript.vbs"
fileStartLocation = GetTags("startfilespec", xmlDirectory)
loginFile = GetTags("login", xmlDirectory)
uninstallFile = GetTags("uninstallspec", xmlDirectory)
installFile = GetTags("installspec", xmlDirectory)
startServiceFile = GetTags("startservice", xmlDirectory)
stopServiceFile = GetTags("stopservice", xmlDirectory)
programName = "MedDispense.Net"
processName = "MedDispense.UI.exe"
serviceName = "M1$Hardware$WCFWindowsService"
main
Sub main
'this is for simulation mode
Set objShell = CreateObject("WScript.Shell")
Include sInstFile
KillRunningProgram processName
wait 3
CopyFilestoLocal
If CheckProgramInstalled(programName) <> False Then
wait 30
Uninstall
End If
wait 100
Install
wait 20
If CheckService(serviceName) = true Then
StopService
End If
wait 10
ChangeFileNames
'ChangeFileNamesforReal
'this is for real hareware situation
wait 5
StartService
wait 60
ReplaceStrings
StartProgram(fileStartLocation)
wait 10
Login
wait 10
End Sub
this script is the one that i intend to install
and I use another PublicVBScript.vbs outside TestComplete for calling some useful methods.
the first script does not contain methods that the second one uses.
the first one do use the methords in PublicVBScript.vbs, but has nothing to do with the second one.
so I'm confused why the second one always run first.
and thank you guys for trying to solve my questions.