How to create global variable in QTP to be used in all actions -
can tell me how define variable in qtp store information @ runtime in 1 action , variable used in other actions same test.
the 2 quickest options variables global scope (though there other ways of passing data around):
environment variables
assign anywhere so:
environment("myvar") = "hello there"
retrieve anywhere so:
x = environment("myvar")
declare variables in library files
declare variable in associated library file , accessible anywhere in test.
declare in attached library file:
dim foo
assign anywhere so:
foo = "bar"
retrieve anywhere so:
x = foo
option 1 preferable code-maintainability standpoint, can pre-define environment variables expect use beforehand "user-defined environment variables" rather magicaly creating global vars in obscure places.
you have option of using datatable pass things around. read manual one.
Comments
Post a Comment