我正在尝试运行一个testcomplete项目和其中的脚本例程。 我使用了以下代码:
Dim pn As String, un As String, rn As String
'Set ProjectSuiteName = "C:\Users\s.amin\Documents\TestComplete 10 Projects\DigiStyle1\DigiStyle1.pjs"
pn = "DigiStyle_App"
un = "login_test1"
rn = "loginApp"
' Creates the application object
Set TestCompleteApp = CreateObject("TestComplete.TestCompleteApplication")
' Obtains the integration object
Set IntegrationObject = TestCompleteApp.Integration
' Opens the project suite
IntegrationObject.OpenProjectSuite ("C:\Users\s.amin\Documents\TestComplete 10 Projects\DigiStyle1\DigiStyle1.pjs")
' Runs the routine
IntegrationObject.RunRoutine(pn, un, rn)
但是我在最后一个语句中得到了语法错误。使用了smartbear网站本身的代码。
答案 0 :(得分:2)
当您使用参数调用过程时,您需要使用Call
关键字:
Call IntegrationObject.RunRoutine(pn, un, rn)
或删除括号:
IntegrationObject.RunRoutine pn, un, rn