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

Can you brief the hurdles you faced during Automation testing?

666


What is the use of an object spy tool in qtp?

641


What is Cross browser testing? Does UFT support it?

712


write a script to validate the content in the web application. (do it by OR method) and (do it by Descriptive method by creating a description object..

1899


What are the views available in quicktest professional?

645






Does quicktest professional (qtp) is unicode compatible?

631


How to find the difference between 2 dates in qtp?

683


How to customize checkpoints with parameters?

3107


What is meant by a Check Point in UFT? Also, explain the applicable Check Points.

788


What are the different types of functions available in qtp and explain ?

660


How u will do versioning in QTP?

1533


Explain the difference between call to action and copy action?

611


How to handle Java tree in QTP?

856


Diff b/w Health care domain and Banking Domain?

4300


Suppose you are using shared objects repository in your test and you want to split your present action? At that time shared object repository is single or it’s also splits?

758