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.

First output value is getting overwritten by second output

This is a discussion on First output value is getting overwritten by second output within the QTP forums, part of the Software Testing category; I want to add the output values of two scenarios in the DataTable during runtime. However, after running the test script only the output value of second scenario is getting ...

Go Back   Geeks Talk > Software Testing > QTP
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 05-16-2007
Expert Member
 
Join Date: Feb 2007
Posts: 1,279
Thanks: 0
Thanked 192 Times in 154 Posts
Geek_Guest has a spectacular aura aboutGeek_Guest has a spectacular aura aboutGeek_Guest has a spectacular aura about
First output value is getting overwritten by second output

I want to add the output values of two scenarios in the DataTable during runtime. However, after running the test script only the output value of second scenario is getting displayed in the Data Table as viewed through the Runtime Table Summary. The first output value is getting overwritten by the second output value.

I tried using the "DataTable.SetNextRow" method, however its not working.
Kindly assist.
Many thanks

Question asked by visitor
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-05-2008
Contributing Member
 
Join Date: Feb 2006
Posts: 85
Thanks: 0
Thanked 3 Times in 3 Posts
kunals is on a distinguished road
Re: First output value is getting overwritten by second output

Can you please elaborate more on what is ur problem as the output value will be written only on the current row and until you pass to next row in ur script the values will be overwritten.

If you want to kep the value of any object then its always better to use the GetRO propery and assign it against some variable.

Hope this helps you can always come back with more clear explanation of your problem.

Thanks,
Kunals.
Reply With Quote
  #3 (permalink)  
Old 01-05-2008
Moderator
 
Join Date: Oct 2007
Location: Frankfort, KY
Posts: 283
Thanks: 3
Thanked 54 Times in 36 Posts
Anshoo_Arora is on a distinguished road
Re: First output value is getting overwritten by second output

Try this:

Save the two output values in "FOutputValue" and "SOutputValue" and use the following code:

(Pre-req: Create a dummy file named dummy.xls in the root folder)

Set ExcelAppl=CreateObject("Excel.Application")
Set WrkBook=ExcelAppl.Workbooks.Open("C:\dummy.xls")
Set sheetPrimary=WrkBook.Activesheet
sheetPrimary.Cells(1,1)=""&FOutputValue
sheetPrimary.Cells(1,2)=""&SOutputValue
WrkBook.Save
ExcelAppl.Quit

Last edited by Anshoo_Arora; 01-05-2008 at 04:48 AM. Reason: Added Explanation
Reply With Quote
The Following User Says Thank You to Anshoo_Arora For This Useful Post:
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
Input and output AnnieL4864 VB.NET 1 11-20-2007 05:12 AM
How many Classes in output JobHelper Java 7 06-12-2007 04:14 AM
Extra whitespace in JSP output Geek_Guest JSP 1 06-05-2007 03:58 AM
Output Value bharathi_ark Testing Issues 5 12-27-2006 07:13 AM
Output Functions RyanJames C and C++ 5 12-20-2006 03:10 AM


All times are GMT -4. The time now is 09:33 PM.


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