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

I'm quite new at QTP. Im doing a web-based app testing. I create something new item and a new link is created in the home page. This link is dynamic as it changes every 3 seconds. Obviously the new link is not in my Object Repo and I am trying to find a way how can I do a check or get the propery of the link I created. I can do it on keyword, but I need to do a check on expert mode, vbscript. I always get an error that is not identified whenever i try to check it (browser(b),page(p).link(newlink). Any idea?

4 Answers  


what is database check point, how will you parameterize the database from seperate data table?

2 Answers   JPMorgan Chase,


i have to pass the testcases into userid anf password of gmail login page using functions you can take your own testcaseslike userdid should take only lowerletters it should not take special charactors and uppercase letters and password should take only numericvalues it should not take alphanumeric and alphabets

2 Answers  


Give me some scripts for 1). checking webpage links (counting links,opening web pages,counting child elements)

2 Answers   CIL,


If I want to run more than one test (With different functionality) with in one script, then what i do? plz. explain with any example.

4 Answers  






Can you give me the code to calculate the total number of Links using the child object in the web page..? is there any other way to calculate number of links with out using the Child objects.??

2 Answers   DST Global Solutions,


Hi Guys, I am very new to QTP tool , In real time environment how to test the application with this tool, 1. How to load application in QTP tool 2. How to write test script in QTP. 3. In manual testing we test login box (user id , password) how can we test this kind of testing with QTP tool with examples . Please guys put some focus on my questions , real time ecperienced answers would be appreciate, advance thanks ,please guys i am expecting ur answers as soon as posible

1 Answers   IBM, INCA,


What are the framework folders?

1 Answers  


Browser("Las Vegas Hotels - Las").Page("Vegas Hotels - Hotels").Link("Luxor") ......here Luxor is a hotel and this is recognised as a link. I have many hotels like Luxor, Palms etc which are all displayed as link...How do I parametrize this by using webtable functions??? ASAP

1 Answers   HP,


Hi, i have a string like "INDIA". I need to display this string vertically in Msgbox?

1 Answers  


How to execute a WinRunner Script in QTP?

1 Answers   Crea,


what is keyword driven framework in qtp.

13 Answers   Cognizant, TCS,


Categories