Private Function CreateTestWithConfigurations(checkLoginTest As Test, _ resourceRootFolder As QCResourceFolder, _ ByRef testResource As QCResource, _ ByRef configResource As QCResource) As Boolean ' Create a test with configurations On Error GoTo FUNC_ERR CreateTestWithConfigurations = SUCCESS ' Check out the test. For code of CheckoutTest(), see example "Checking out a Test" Dim testVCS As VCS, checkInOutOK As Boolean Set testVCS = CheckoutTest(checkLoginTest, "Create Configurations", checkInOutOK) If Not checkInOutOK Then errmsg = "Error checking out checkLoginTest" GoTo FUNC_ERR End If Dim resourceRootFolderFactory As QCResourceFactory Set resourceRootFolderFactory = resourceRootFolder.QCResourceFactory ' Create a resource to hold the parameter data at the test level errmsg = "Error creating resourceRootFolderFactory" Set testResource = resourceRootFolderFactory.AddItem("Test Data Resource") testResource.ResourceType = "Data table" testResource.FileName = "test.xml" testResource.Post errmsg = "Error loading testResourceStorage" Dim testResourceStorage As IResourceStorage Set testResourceStorage = testResource testResourceStorage.UploadResource "C:\temp", True ' Set the resource to be the data resource at the test level errmsg = "Error creating testDataRelation" Dim testDataRelation As ISupportDataRelation Set testDataRelation = checkLoginTest Dim theDataMapping As String theDataMapping = _ "<MappingData>" & _ "<MappingElement>" & _ "<ParameterName><![CDATA[FlightNo]]></ParameterName>" & _ "<MappedToName><![CDATA[flight_number]]></MappedToName>" & _ "</MappingElement>" & _ "</MappingData>" testDataRelation.CreateDataRelation testResource.ID, theDataMapping ' Create a new configuration for the test errmsg = "Error creating configVIP" Dim cFact As TestConfigFactory Dim configVIP As TestConfig Set cFact = checkLoginTest.TestConfigFactory Set configVIP = cFact.AddItem(Null) configVIP.Field("TSC_NAME") = "Configuration for VIP user" configVIP.Field("TSC_DESC") = "Check login with VIP user" configVIP.Post ' Create a resource to hold the parameter data at the configuration level errmsg = "Error creating configResource" Set configResource = resourceRootFolderFactory.AddItem("Configuration Data Resource") configResource.ResourceType = "Data table" configResource.FileName = "config.xml" configResource.Post errmsg = "Error loading configResource" Dim configResourceStorage As IResourceStorage Set configResourceStorage = configResource configResourceStorage.UploadResource "C:\temp", True ' Set the resource to be the data resource at the configuration level errmsg = "Error creating cDataRelation" Dim cDataRelation As ISupportDataRelation Set cDataRelation = configVIP cDataRelation.CreateDataRelation configResource.ID, "" ' Set the configuration to use the data resource at the configuration level errmsg = "Error setting configVIP data state" configVIP.Field("TSC_DATA_STATE") = 2 configVIP.Post ' See example "Checking in a Test" checkInOutOK = CheckinTest(testVCS, "Created configurations") If Not checkInOutOK Then errmsg = "Error checking in checkLoginTest" GoTo FUNC_ERR End If Exit Function FUNC_ERR: CreateTestWithConfigurations = FAILURE ErrHandler err, "CreateTestWithConfigurations", errmsg, NON_FATAL_ERROR End Function