Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

How to save a value in runtime into datatable?

This is a discussion on How to save a value in runtime into datatable? within the QTP forums, part of the Software Testing category; My program is just to find a dif. b/w two variable and i need to store it in datatable permanently. my code is like this: "a= .. .. b= c=b-a" ...

Go Back   Geeks Talk > Software Testing > QTP
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 07-09-2009
Junior Member
 
Join Date: Jul 2009
Location: Chennai
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
rvsvimaljamesraj is on a distinguished road
How to save a value in runtime into datatable?

My program is just to find a dif. b/w two variable and i need to store it in datatable permanently.
my code is like this:
"a=
..
..
b=
c=b-a"
now i need to store this variable "c" into data table.
I have already tried
datatable.value("Output",global)=c
it stores the value but after running the Column is empty.
How can i do it? Is there any alternate?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-09-2009
Expert Member
 
Join Date: Apr 2008
Location: Tamilnadu
Posts: 1,465
Thanks: 15
Thanked 150 Times in 141 Posts
deepasree has a spectacular aura aboutdeepasree has a spectacular aura about
Re: How to save a value in runtime into datatable?

Hai friend

Method one

Add parameter at the runtime and then enter the values. Run time Datatable will only be visible during run time. If you need to view the values present in the datatable then export it to an excelsheet.

Dim i
DataTable.ImportSheet "C:\Documents and Settings\Deepa\Desktop\Add2.xls",1,1

For i=1 to Datatable.GetRowCount
a=DataTable.Value("Num1","Global")
b=DataTable.Value("Num2","Global")
c =cint(a)+cint(b)
e=Datatable.GetSheet ("Global").AddParameter("Sum",c)

Datatable.Export("C:\Add1.xls")

Method two

If you don't need to export the datatable value then you can simply see the run time datatable in this path

Excel- This is the name of the test which I have given

Res 1- I have executed the test once so I am clicking on Res1

Click on Excel folder->Res 1-> Report->Default.xls

In the default.xls you can find run time datatable values here

Thanks
Deepa
Reply With Quote
Reply

  Geeks Talk > Software Testing > QTP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Looping and DataTable Davis2sa QTP 6 07-30-2009 09:12 PM
datatable.import rajaputra QTP 3 06-27-2009 05:02 AM
save URL in Global or action datatable amnak QTP 1 07-18-2008 01:07 AM
Exporting Runtime datatable to excel sheet ashwinshelke QTP 1 05-27-2008 04:46 AM
Datatable and parameterization newqtp QTP 1 04-11-2008 10:43 PM


All times are GMT -4. The time now is 07:24 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved