Micro Focus QTP (UFT) Forums
global object which can be called in any action - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: global object which can be called in any action (/Thread-global-object-which-can-be-called-in-any-action)



global object which can be called in any action - excellentpawan123 - 03-02-2015

I want to crate global object which can be called in any action i tried following code but it does not work.

Code:
Public unit

Function getunitname
         Set fso=createobject("Scripting.Filesystemobject")
         Set unit = fso.CreateTextFile "C:\QTP\xyz.txt"
End Function


on calling this in any action, it is not working

Please help


RE: global object which can be called in any action - babu123 - 03-17-2015

use environment variable method...


RE: global object which can be called in any action - babu123 - 04-01-2015

Plz ignore my above answer...Use


Code:
public Function getunitname
         Set fso=createobject("Scripting.Filesystemobject")
         Set unit = fso.CreateTextFile "C:\QTP\xyz.txt"
End Function