从外部应用程序运行testcomplete脚本

时间:2014-03-31 09:00:50

标签: excel-vba vbscript testcomplete vba excel

我正在尝试运行一个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网站本身的代码。

1 个答案:

答案 0 :(得分:2)

当您使用参数调用过程时,您需要使用Call关键字:

Call IntegrationObject.RunRoutine(pn, un, rn)

或删除括号:

IntegrationObject.RunRoutine pn, un, rn