IN EXCEL SHEET OF qtp SUPPOSE I ENTERED 10 NUMBERS RANDOMLY
I HAVE TO GET TOTAL OF TEN NUMBERS IN THE 11 COLUMN USING qtp
GIVE CODE TO IT USING qtp

Answers were Sorted based on User's Feedback



IN EXCEL SHEET OF qtp SUPPOSE I ENTERED 10 NUMBERS RANDOMLY I HAVE TO GET TOTAL OF TEN NUMBERS IN ..

Answer / sudha sharma

Pre Condition : Enter 10 randon numbers in the datatable of
QTP. Write down the following code :

For i=1 to 10
datatable.SetCurrentRow(i)
total=cint(datatable.Value(1,1))+total
Next

datatable.SetCurrentRow(i)
datatable.value(1,1)=total

The total of 10 random numbers get posted in the run time
data table. You can view it through automation -> results -
> run time data table.

This is for QTP data table. If the data is in the excel
sheet then you have import the data.

Is This Answer Correct ?    2 Yes 0 No

IN EXCEL SHEET OF qtp SUPPOSE I ENTERED 10 NUMBERS RANDOMLY I HAVE TO GET TOTAL OF TEN NUMBERS IN ..

Answer / laxmi

datatable.ImportSheet "C:\Documents and
Settings\Administrator\Desktop\excel.xls",1,Global

then go to test->settings->run->check run one iteration
radio button

or i= datatable.ImportSheet "C:\Documents and
Settings\Administrator\Desktop\excel.xls",1,Global
for i=1
//body
next

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More QTP Interview Questions

what is memory leakage?

15 Answers   ITC Infotech, Panamax, TIT,


I am using descriptive programming for my project.when QTP deosn't identity or recognize a object by record and playback method,is it possible to make QTP identify that object using descriptive programming? Note: The object doesn't have unique properties and same properties used in Record and playback are only available, no extra properties are defined.

3 Answers  


What is optional step in qtp? How you can add optional step in qtp?

0 Answers  


What is meant by Pseudo Code?

5 Answers   Satyam,


Differences between text and test area checkpoints?

0 Answers  






How to pass parameters to Actions Pls anybody can give the answer.. Thanks in advance...

2 Answers   Navis,


what are inputs for automation?

3 Answers  


Test script is generated and it is enhanced.It is required to be saved.But the disk space is insufficient.You are not permitted to delete any scripts.How are you going to save?

1 Answers   Accenture, DELL,


Hi, how can we retrieve a specific value from Excel Sheet (Not datatable. for externel file).i mean to say from .xls file. and also tell me from xml file and .doc file. and how can u parameterize ur script from .xls file.(Not data table).

2 Answers   Cap Gemini,


1. IS A VIRTUAL OBJECT USED WHEN THE LABEL IS NOT RECOGNIZED BY QTP

7 Answers   Ordain Solutions,


I am automating a Java application. This application is developed using SWT. I am not able to get the GUI object. Even i tried with Java add-in. In tutorial it states SWT is not supported any idea. Anybody worked in such appln. My question is whether it is possible to record the GUI object of SWT appln. how it is possible.

1 Answers  


Can we write class for vb script in Quick Test Professional?

2 Answers   JPMorgan Chase,


Categories