Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Relative Path problem
#2
Not Solved
Code:
TestDir=Environment.Value("TestDir")
TestNameLength=Len(Environment.Value("TestName"))
TestDir=Left(TestDir,Len(TestDir)-TestNameLength)
Set excel = CreateObject("Excel.Application")
InitFilePath=TestDir+"\Init\Init.xls"
Set workbook = excel.Workbooks.Open(InitFilePath)
Set worksheet=workbook.Worksheets("Sheet1")
Set url = worksheet.Cells.Find("url")
urladd= worksheet.Cells(url.row,(url.column)+1)
excel.Quit
SystemUtil.Run urladd

my test directory(folder) is "Test" and am having a folder named "Init" beside my test folder. there i am having a excel file "Init.xls" to store url of the application. i read it using the above code. the idea is, i have used the
predefined environment variable "TestDir" for my logic.
Reply


Messages In This Thread
Relative Path problem - by Kakashi - 02-15-2012, 06:43 PM
RE: Relative Path problem - by inborntester - 02-15-2012, 10:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to get relative path by using testdir environment variable Sathyaprasad 1 2,071 11-30-2017, 02:21 AM
Last Post: supputuri
  Path of Flight reservation Window is not recorded in HP UFT 12.52 version mailtokopalverma@gmail.com 1 2,817 04-01-2016, 05:34 PM
Last Post: vinod123
  X path Identification vasavi.vasavi 1 3,128 07-29-2015, 10:44 AM
Last Post: kbhargava505
  environment variable path for qc automation2012 0 2,987 01-18-2015, 08:18 AM
Last Post: automation2012
  Change Object Repository File Path for ExternalActions MasterChief 1 4,825 11-13-2014, 06:05 PM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)