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
Can you brief the hurdles you faced during Automation testing?
What is the use of an object spy tool in qtp?
What is Cross browser testing? Does UFT support it?
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..
What are the views available in quicktest professional?
Does quicktest professional (qtp) is unicode compatible?
How to find the difference between 2 dates in qtp?
How to customize checkpoints with parameters?
What is meant by a Check Point in UFT? Also, explain the applicable Check Points.
What are the different types of functions available in qtp and explain ?
How u will do versioning in QTP?
Explain the difference between call to action and copy action?
How to handle Java tree in QTP?
Diff b/w Health care domain and Banking Domain?
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?