Micro Focus QTP (UFT) Forums
Output is different from two different machines for the same block of code in QTP. - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Output is different from two different machines for the same block of code in QTP. (/Thread-Output-is-different-from-two-different-machines-for-the-same-block-of-code-in-QTP)



Output is different from two different machines for the same block of code in QTP. - bdash_10 - 04-13-2012

I executed the following block of code from two machines(having QTP11).

Code:
str_ImportedDataFileName="NewExcel.xls"
Set fso = CreateObject("Scripting.FileSystemObject")
Set FilePath=fso.OpenTextFile("C:\DataFilePath.txt",1)
str_Path=FilePath.Read(30)
str_ImportedDataFilePath=trim(str_Path) + str_ImportedDataFileName
print str_ImportedDataFilePath


(DataFilePath.txt is created inside C Drive and the path written in this file is :- " C:\Datasheet\ ")

The line "print str_ImportedDataFilePath" is producing output in single line in one machine and in two lines in another machine. The outputs are:
Machine1: C:\Datasheet\
NewExcel.xls


Machine2: C:\Datasheet\NewExcel.xls

I use this code to import datasheet from some location in my machine.
The parent location path of the datasheet is provided in DataFilePath.txt

When I'm executing this code from Machine2, it's working fine.
But When I'm executing this code from Machine1 It's showing Error in importing file as the path is not a single line.

I don't understand what to do here. Is this any setting issue or some problem is there in the QTP present in Machine1?


Please help me in overcoming this issue.

Thanks in advance,

Bdash