I always meet the issue "Failed to save the test or business component" when tried to use SaveAs method to save my QTP script to QC. I have confirmed the path is valid and existing. The strange thing is I can successfully save the script when use older folder path. Could some one have any idea about it?
Dim QTPApp 'As QTP Application
Set QTPApp = CreateObject("QuickTest.Application")
QTPApp.Visible = True
QTPApp.Open strLocalTCPath, False ' Open test in read only mode
'If connection not already established then establish connection(QTP already running)
If Not QTPApp.TDConnection.IsConnected Then
QTPApp.TDConnection.Connect strServer, strDomain, strProject, strUserName, strPassword, False
'Change setting configuration
'Save the script in QC
QTPApp.Test.SaveAs "[QualityCenter] " & strQCPath & "\" & strQCTestName & "1", False, False
Instead of save as feature in QTP, you can try this way
open your test plan in QC, just copy and paste the desired test, and rename it -if you want. So, now you have a replicated evrsion of your test, you can change it in QTP.
the old path was created couple of months ago. I can successfully use QTP SaveAs method to save the script in the path. However, when I create a new one with the same level, the SaveAs method always failed.