Forum Discussion

Jyotikrushna_Mo's avatar
Jyotikrushna_Mo
Occasional Visitor
11 years ago

How to Use IntegrationObj.RunTestByName(Project anme,test name)

Hi



I am getting error like "Unable to find the specified element. Project: SmokeTest, TestName:Script|GEO_Admin_IIIE"". I have written the following code:



Sub TC()

Dim TestCompleteObject

Set TestCompleteObject = GetObject(, "TestComplete.TestCompleteApplication")

TestCompleteObject.Visible = "True"

Set IntegrationObj = TestCompleteObject.Integration

 IntegrationObj.OpenProjectSuite ("C:\Framework\Test Activity Scripts\SmokeTest\TestComplete\SmokeTest.pjs")

   If Not IntegrationObj.IsProjectSuiteOpened Then

    MsgBox "The project suite was not opened."

    ' Closes TestComplete

    Else

    MsgBox "Project opened"

  End If

IntegrationObj.RunTestByName "SmokeTest", "Script|GEO_Admin_IIIe"



End Sub





Here the Project suit Name and location is : C:\Framework\Test Activity Scripts\SmokeTest\TestComplete\SmokeTest.pjs"



Project Name in the above Project Suite is : SmokeTest



My Test presents in the above projects is : Project Name -> Advanced -> Script -> GEO_Admin_IIIe



Could anyone please help me? or can you please an example ?

1 Reply

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Jyotikrushna,


     


    GEO_Admin_IIIE is the name of the script function. You need to specify the routine to be called like this: Script|GEO_Admin_IIIE|Main