Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Output is different from two different machines for the same block of code in QTP.
#1
Not Solved
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  table output values shipu 1 2,243 01-24-2014, 10:06 AM
Last Post: supputuri
  Do you think it professional QTP code ? learnqtp 0 2,812 06-21-2012, 03:48 AM
Last Post: learnqtp
Exclamation QTP - Code to select a link Unleash Rajesh 3 16,714 01-03-2012, 06:57 PM
Last Post: prabhukrishna
  output check point sdazad 11 10,182 11-02-2011, 10:57 AM
Last Post: Ankesh
  How to recycle application pool on remote machine using QTP code. rajivr81 0 2,170 11-01-2011, 11:34 AM
Last Post: rajivr81

Forum Jump:


Users browsing this thread: 1 Guest(s)