Absolute paths vs. relative paths
Question ID: 104891
1
0

I’m using the following code to add Object Repositories to my test via code. The problem is, when I do, it uses the absolute path (C:\\MyTestORs\\MyOR.tsr) rather than a relative path. This is a problem because not all of our users put their tests and ORs on the C:\\ drive. How do I get QTP to use the relative path instead of the absolute path?

Set MyQTPAction = qtApp.Test.Actions("Action1")

Set qtpRepositories = MyQTPAction.ObjectRepositories

qtpRepositories.RemoveAll

qtpRepositories.Add ".\\MyOR.tsr", 1 ‘ Add the repository to the collection

Marked as spam
Posted by (Questions: 387, Answers: 66)
Asked on March 12, 2013 6:31 pm
209 views
Answers (2)
1
Private answer

I just saw that problem recently. There is a hotfix you'll have to get through support, cause it's not a publicly released patch. It's hotfix **QTP_00882 - Fix Relative Path Issue for ObjectRepositories.Add Automation Method.**

> ''This hotfix fixes a problem that caused QuickTest to change relative paths to absolute paths when using theObjectRepositories.Add Automation method.
> After installing this hotfix,QuickTest will be able to search for ashared object repository via a relative path ONLY if the relative path is listed in the Folders list(for example, via the FoldersOptions Collection object). ''

Marked as spam
Posted by (Questions: 17, Answers: 807)
Answered on March 12, 2013 6:42 pm
0
I was able to get that from support and it fixed the problem!
( at March 12, 2013 10:07 pm)
0
Private answer

This is broken again (as of UFT 14.53)

Marked as spam
Posted by (Questions: 0, Answers: 2)
Answered on October 14, 2019 3:29 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top