Library files Association
I am associating the library files to my test which are available in my desktop,so in the path it include system username also, if i copy my test to another PC then that time username will be change, then again i have to associate all library files to the test.
How to overcome this issue in association?
if we dynamically call the Library files with using 'Executefile' method,then that time with using environment("UserName"), we can overcome this, but with using association how to overcome?
Thanks in advance,
Last edited by Chowdary287; 07-11-2013 at 09:06 PM.
place the library files inside the test folder and associate
It sounds as if it has to do with "relative path". I don't see this concept when attaching the libraries under settngs. I can not think of a way to do this.
Use a different start location rather than your desktop? Ideally your scripts would be in a shared location rather the duplicated anyway. But for this issue you could at least move them to a directory that excludes user name like c:\scripts
You can try the native windows shortcut %USERPROFILE%\Desktop\ but I think the file dialog will replace that when you save.
Last edited by NoUse4aName; 07-12-2013 at 06:13 AM.
Any of them
1. Share drive
2. location mentioned by "NoUse4aName"
3. Change the association logic
Thank you all for your suggestions
Put the library files inside the Test Folder and then access the path where Test folder is kept by inbuilt Environment Variable "TestDir"
Originally Posted by guptavijay
Could you please elaborate this one?
i placed the Library files inside the test folder after then how will i access those ?
While associating the libraries with the Test do not provide the full(exact) path, instead just provide the library file name. Now go to Tools -> Options -> Folders and provide the folder where you have kept all the automation assets. When you run the script it search all the associated file in the folders provided under folders option and make the association. Setting for folder option needs to be done once on any machine or on QTP, and it will be implemented for all the Tests.
OR you can also use the Pathfinder.locate method of QTP to search for the file. Pathfinder.locate will return the path which you can use to associate the file at run time.
testdir will be starting location of relative path from all machine.
Executefile Environment.Value("testdir") & filename will add the file in action.
YOGI - Technology Tree QTP: QTP - Ways to associate Library in QTP