Need help with Script.
Ours is a financial Market product for Trade exchanges.
Functionality is to pick up XML file load it and check the content using XML checkpoint.I just need help with the looping part so that it works for all the three ina single run.
The existing script is running fine for any of one exchange at a time.How do i make my script intelligent to run for all the three exchanges in one run.Below is the script:
FilePath= DataTable("ETMXMLFilePath", dtLocalSheet)
Dim fso: Set fso=createObject("Scripting.fileSystemObject")
Dim CurrentFolder: Set CurrentFolder = fso.GetFolder(FilePath)
Dim Nameoffile, MM,YY,DD, MyTime, AddressOfString,XMLFileDate,XMLFileName1,FileNameWithPath
Dim MyArray
Mytime = Now
MM = Month(Mytime)
YY = Year(Mytime)
DD = Day(Mytime)
FileName = "XNYS_"+CStr(YY) +"-"+CStr(MM)+"-"+CStr(DD)
XMLFileDate=CStr(YY) +"-"+CStr(MM)+"-"+CStr(DD)
DataTable.GetSheet("CheckETM-XMLFile").GetParameter("XMLFileDate").Value=XMLFileDate
Dim Files: Set Files = CurrentFolder.Files
Dim File
For Each File In Files
if CStr(MID(File.Name, 1,15)) = CSTR(FileName) Then
XMLFileName1 = File.Name
End If
Next
msgbox XMLFileName1
FileNameWithPath=FilePath+"\"+XMLFileName1
DataTable.GetSheet("CheckETM-XMLFile").GetParameter("XMLFileName").Value= FileNameWithPath
XMLFile("XTSE_2006-11-14T16_17_57").Check CheckPoint("XTSE_2006-11-14T16_17_57")
XNYS is the name of the exchange.The other two exchanges are XTSE and FORX.
The script is good for anyone of the three exchanges.But I have to run all the three exchanges in one script.Can anyone please help.I am pretty new to QTP and Scripting.
Ours is a financial Market product for Trade exchanges.
Functionality is to pick up XML file load it and check the content using XML checkpoint.I just need help with the looping part so that it works for all the three ina single run.
The existing script is running fine for any of one exchange at a time.How do i make my script intelligent to run for all the three exchanges in one run.Below is the script:
FilePath= DataTable("ETMXMLFilePath", dtLocalSheet)
Dim fso: Set fso=createObject("Scripting.fileSystemObject")
Dim CurrentFolder: Set CurrentFolder = fso.GetFolder(FilePath)
Dim Nameoffile, MM,YY,DD, MyTime, AddressOfString,XMLFileDate,XMLFileName1,FileNameWithPath
Dim MyArray
Mytime = Now
MM = Month(Mytime)
YY = Year(Mytime)
DD = Day(Mytime)
FileName = "XNYS_"+CStr(YY) +"-"+CStr(MM)+"-"+CStr(DD)
XMLFileDate=CStr(YY) +"-"+CStr(MM)+"-"+CStr(DD)
DataTable.GetSheet("CheckETM-XMLFile").GetParameter("XMLFileDate").Value=XMLFileDate
Dim Files: Set Files = CurrentFolder.Files
Dim File
For Each File In Files
if CStr(MID(File.Name, 1,15)) = CSTR(FileName) Then
XMLFileName1 = File.Name
End If
Next
msgbox XMLFileName1
FileNameWithPath=FilePath+"\"+XMLFileName1
DataTable.GetSheet("CheckETM-XMLFile").GetParameter("XMLFileName").Value= FileNameWithPath
XMLFile("XTSE_2006-11-14T16_17_57").Check CheckPoint("XTSE_2006-11-14T16_17_57")
XNYS is the name of the exchange.The other two exchanges are XTSE and FORX.
The script is good for anyone of the three exchanges.But I have to run all the three exchanges in one script.Can anyone please help.I am pretty new to QTP and Scripting.