HI,

Based On The Information Below Write A Data Driven test
Script
Edit Box 1 Should take Value From Num1 Column
Edit Box 2 Should take Value From Num2 Column
Click On Add Button,
Get The Value Of Exp res Column,
Get Value From Actual Result Edit Box ,
Compare Two Values, Write Pass / Fail Value Into Result
Column

Thanks In Advance... Kavitha

Input.Xls
Num1 Num2 Exp res Act res Result
10 30 40 40 Pass
50 40 90 90.5 -
- - - - -
- - - - -
- - - - -

Answer Posted / sonia

Set oexObj = CreateObject("Excel.Application")
Set oWb = oexObj.workbooks.open("c:\Input.xls")
Set sheet=oWb.worksheets(1)
row=sheet.usedrange.rows.count
col=sheet.usedrange.columns.count
For i=2 to row step 1
col1=0
For j=1 to col-3 step 1
colvalue = sheet.cells(i,j)
col1= col1+CInt(colvalue)
Next
col1=sheet.cells(i,4)
If CInt(col1) = CInt(sheet.cells(i,3)) Then
sheet.cells(i,5)="Pass"
Reporter.ReportEvent micPass, "Complate", "Expected Result"
&CInt(col1) &vbcrlf&" Actual Result."&vbcrlf& CInt(col1) =
CInt(sheet.cells(i,3))
else
sheet.cells(i,5)="Fail"
End If
Next
oWb.save
oexObj.quit
Set oWb=nothing
Set oexObj=nothing

Use this code it work very fine.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the pros and cons between QTP and Rational Robot

3283


How you can decide which type of object repository you have to use?

701


How many tabs are available in debug viewer pane?

648


How to explain a banking project in interview as a test engineer???

2595


we use a file extension .properties why is it used and where do we use it plz help me out with detailed explanation and navigation of how to use on the QTP 8.2?

1630






What is the difference between the keyword view and expert view?

527


Whats the realtime QTP testing process

1991


Can we record using all the modes in a single script? Explanation with example is appreciated

1388


how can i pass a "cript"as a parameter in to a function

1457


How many types of parameters are available in quicktest professional?

522


how we connect 1. qtp9.2 to the quality center9.0? 2. Load runner8.0 to the quality center9.0

1482


What is debugging? How you debug your script?

606


What is environment variable in qtp and why to use it?

547


what could go wrong with test automation?

1507


i am looking job in perfomance testing using Loadrunner any one help me a project plz......?(Chandana) chs_29@rediffmail.com

1462