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.

Geting data from odd rows of an excel sheet,

This is a discussion on Geting data from odd rows of an excel sheet, within the WinRunner forums, part of the Software Testing category; If i am in the database testing with wirnunner tool, if i want to the get the data only from the odd rows of an excel sheet, What is the ...

Go Back   Geeks Talk > Software Testing > WinRunner
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 12-23-2006
Expert Member
 
Join Date: Oct 2006
Posts: 689
Thanks: 0
Thanked 53 Times in 44 Posts
JobHelper is on a distinguished road
Geting data from odd rows of an excel sheet,

If i am in the database testing with wirnunner tool,
if i want to the get the data only from the odd rows of an excel sheet,
What is the statements i have to add to the TSL?
Pls give with an example.
Thanks in advance

NOTE [This question was asked by prasad.gandra]
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-23-2006
Expert Member
 
Join Date: Nov 2006
Location: Hyd-IND
Posts: 528
Thanks: 1
Thanked 63 Times in 50 Posts
sutnarcha is on a distinguished road
Re: Geting data from odd rows of an excel sheet,

Just a small logical change is needed to solve this problem.

Eg:
******************
for(i=1;i<=n;i++)
{
ddt_set_row(t,i);
set_window ("Inputs", 2);
a=ddt_val(t,"I1");
b=ddt_val(t,"I2");
edit_set("ThunderTextBox",a);
edit_set("ThunderTextBox_1",b);
button_press ("Ok");
edit_check_info("ThunderTextBox_2","value",a+b);
}
******************
This 'for' loop takes values from 2 columns of Excel sheet (I1 and I2) and adds them in the application after clicking 'OK' button. Then it checks the application output (Actual, 'value') with Expected (a+b).

Now, here if you want WinRunner to get the data only from odd rows of the Excel sheet then just change counter increment part of 'for' statement. It can be changed as below:

for(i=1;i<=n;i=i+2)

This 'for' loop is executed with values of 'i' in the following series
1,3,5,7,9..........................

This is one way to get what you want. There are many more ways.
__________________
Lack of WILL POWER has caused more failure than
lack of INTELLIGENCE or ABILITY.

-sutnarcha-
Reply With Quote
  #3 (permalink)  
Old 10-18-2007
Moderator
 
Join Date: Sep 2007
Location: Chennai, INDIA
Posts: 406
Thanks: 2
Thanked 197 Times in 91 Posts
sridharrganesan has a spectacular aura aboutsridharrganesan has a spectacular aura aboutsridharrganesan has a spectacular aura about
Re: Geting data from odd rows of an excel sheet,

for(i=1;i<=n;i=i+2)
{
ddt_set_row(t,i);
set_window ("Inputs", 2);
for (j=1;j<=255;j++)
{
a=ddt_val(t,"j");
b=ddt_val(t,"j+1");
edit_set("ThunderTextBox",a);
edit_set("ThunderTextBox_1",b);
button_press ("Ok");
edit_check_info("ThunderTextBox_2","value",a+b);
}
}

the above for loop will add odd rows of the columns from 1 to 256. (as the excel has 256 columns)
Reply With Quote
Reply

  Geeks Talk > Software Testing > WinRunner

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
reading data from excel sheet in QTP JobHelper QTP 12 3 Weeks Ago 09:46 AM
Automating Excel Formulaes JobHelper QTP 2 02-19-2008 03:11 AM
Display n-1 rows from a table dbtester SQL Server 3 02-07-2008 08:11 AM
100 test cases from TD into an excel sheet Lokesh M Test Director 2 12-23-2006 04:20 AM
Code for getting data from excel sheet JobHelper WinRunner 0 12-20-2006 07:08 PM


All times are GMT -4. The time now is 04:06 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