Highlighted
Respected Contributor.
Respected Contributor.
496 views

Save a runtime value

Hello guys 

Is there any way to store UFT runtime data permanently?   The methods that I'm looking for is saving value and possible to using it in anywhere and anytime.

a="cccccc" 

Datatable.value("xxxxx")=a

Datatable.export("xx/xx/xx") 

I'm only using above method. But If I need to use in another action,  I have to import excel file again. 

Tags (1)
0 Likes
6 Replies
Highlighted
Honored Contributor.
Honored Contributor.

Hi.

Consider using TESTARGS("<arg_name>") in your test and actions.

Please view attached image. 

The paramters you will define in your TEST level, will be accessible throught your various actions.

ggg = testargs("Param1")

testargs("Param1") = 25

testargs("Param1") = "my_string"

and so forth...

Try it.

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

ggg=10 and will be accessible through all the actions in test every time? (sorry i have not qtp now) and its value will be changed to 25 and "my string" from script below?

testargs("Param1") = 25

testargs("Param1") = "my_string"

if it is, what I have searched is that. 

Thank you lot. 

 

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Please view the attached image...
When you define a test level parameter, yes it will be accessible throught all the actions associated with that Test.

When looking at the solution explorer,  DOUBLE click your TEST , a graphical view wil lbe displayed. Then choose menu View->Properties and the right side pane will show. From there you can add Input Params or Output params.

Good luck!

 

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

I'm assuming your actions are not in the same UFT script?

Mark Smith.

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Yes it is

 

 

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Then you can use the Global DataTable to share values between actions.

Mark Smith.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.