Unified Functional Testing Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

Relatively new to QTP and have a seemingly stupid problem--saving a test with VBA.

Highlighted
Occasional Visitor

Relatively new to QTP and have a seemingly stupid problem--saving a test with VBA.

[ Edited ]

I want to associate a shared object repository with a test. So far, I'm using

 

Dim qtpApp

 

set qtpApp = createObject ("QuickTest.Application")

 

qtApp.Test.Actions("Action1").ObjectRepositories.Add  "path to shared object repository", 1

 

qtApp.Test.save

 

set qtApp = Nothing

 

So, I've read the documentation on this. It should be working. But I'm getting "Failed to save the test or business component." And when I go to debug mode after trying to run the test, I see that the object repository has been associated with the test and the object repository contains what I expect it to. 

 

The odd thing is, if I comment out the objectRepositories.Add line, the thing runs fine. It seems that if there hasn't been any changes, the qtApp.Test.save does not throw an error. 

 

So. My question is twofold, really. 

 

First: Anyone have any knowledge of this problem?

 

Second: Is there any way to get better error messaging than the vague "Failed to save the test or business component."?