Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
location function
#1
Solved: 11 Years, 4 Months ago
hello,

can any one please explain below function:

i understand function object but "TestLocation=objQTP.Test.Location" in this line i am not understand "Test" role.

Code:
FUNCTION GetFileLocation (ByRef sFolderName, ByRef sFileName)

   Dim objQTP
   Set objQTP = CreateObject("QuickTest.Application")
   TestLocation=objQTP.Test.Location
   var=split(TestLocation,"\")
   i=UBound(var)
   var(i-1)=sFolderName
   var(i)=sFileName
   TestDataLocation=join(var,"\")
   GetFileLocation = TestDataLocation
   Set objQTP = Nothing
  
END FUNCTION
Reply
#2
Solved: 11 Years, 4 Months ago
Hi,

The test method will bring the current test into context.
But, I don't understand what your doing here. Can you tell me what was your insight of this function?
Why you need this function?

Thanks,
Sri
Thanks,
SUpputuri
Reply
#3
Solved: 11 Years, 4 Months ago
Thanks, actually in this function i am simply retrieve excel sheet location for import data sheet in script................

if possible please explain this in brief
Reply
#4
Solved: 11 Years, 4 Months ago
Hi,
You can use environment inbuilt variable to get the location of you test and use that.
Code:
'Paste this code in a saved test
msgbox Environment("TestDir") ' you can see the location of your test
Let me know if you need any more info.
Thanks,
SUpputuri
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to paste file location in QTP camillelola 0 1,541 08-09-2018, 10:54 AM
Last Post: camillelola
  Calling a function in a Test Script from a function library anupam4j 3 6,127 06-26-2015, 12:31 AM
Last Post: babu123
  Selecting file saved in a location excellentpawan 1 4,067 02-25-2014, 02:05 PM
Last Post: guin.anirban
  Copy file to network shared location sams001 0 3,165 04-03-2013, 02:10 AM
Last Post: sams001
MyBB Saving an excel file with the same name and same location after updating few columns pKrishna 1 4,956 01-04-2013, 04:40 PM
Last Post: Ankesh

Forum Jump:


Users browsing this thread: 1 Guest(s)