Micro Focus QTP (UFT) Forums

Full Version: Exporting the runtime value to the local datatable.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If suppose im giving an input value while runtime with time stamp..
How will i get that added value to my local sheet..
Because i have to reuse that input value
recently added in the application and the same value exported to the datasheet for data comparison...


Please tel me some method...
You can use a global variable to store that timestamp and then you can write in to the local datasheet.
Can you explain what you are doing?..you want to know how to write in to the datasheet or pass the value through the actions?
Hi ,
Ill explain u clearly what i need.. below is the sample code

Code:
Browser().page().frame().webedit().set "abc"&dates &time
//save.click
Browser().page().frame().webedit().set "abc"&dates &time
//save.click
Browser().page().frame().webedit().set "abc"&dates &time
//save.click

ill execute the above code for 3 times in a loop ... so that three distinct timestamp values will be created in my application.

Now i want these three values to be taken to my master sheet in runtime once it saves one by one .

So that from mastersheet again ill give these same 3 values as input to my application in another script..

i think ur clear now.. if not pls tel me .. ill explain u more than this..


Its very urgent .. pls someone help
Hi,

if the value ("abc"&dates &time) abc is static and only the date and time changes. then you can store the value in a global variable and use it in all the place.

If u use a common function file for all the scripts then store the value in the library file and use it in all the places.

EX:
Public A
A = "abc"&dates &time

I am sorry if i am wrong.
'this will get the value which you need in a variable myVar and then 'write that in a datasheet. You can also use
Code:
webedit().Object.Value
myVar = Browser().page().frame().webedit().GetROProperty("value")
hope this helps
Code:
myVar = Browser().page().frame().webedit().GetROProperty("value")

or

Code:
myVar = Browser().page().frame().webedit().Object.Value

and simply set myVar to the datasheet

Hope this helps
Hi ur near my doubt..
My doubt is how to set that MyVar to input datasheet during runtime
pls clarify this
Hey,

As said in the previous post you can capture the value you have entered and use the below similar function to put it into DATATABLE.
I'm not sure whether this will actually save the data table.

Code:
datatable.Value("Sheet_1",Global) = val

Hope this helps you....
Code:
DataTable.GetSheet ("Global").AddParameter "A", myVar
This has some kinks in it and will only add values to a run time data table. I'll look into more detail on my next break and reply as soon as a viable solution comes to mind