Hi Suresh,
I would like to throw some light on this problem.
I assume here that you have your values imported in a data table and you
want to compare those against the values present in the webtable.
Following methods will solve your problem.
1. GetCellData(Row,Column)
- Following code makes use of GetCellData.
Lets say your values are in a single column and 4 rows and the column name
is Values.
So it would look like below in datatable when you import your data.
Values
Value1
Value2
Value3
Value4
Now if you want to compare these values against values in webtable you can
use getcelldata in following manner
Set ObjCompare = DataTable.GetSheet(Sheetname).GetParameter("Values")
For i = 1 to 4
strDT = ObjCompare.ValueByRow(i)
strWT = Browser("").Page("").WebTable.GetCellData(i,1)
If strComp(strDT,StrWT) = 0 then
MsgBox "The Value is present in the WebTable."
Else
MsgBox "The Value is not present in the WebTable."
End if
Next
Else if you want verify whether values present in datatable are present in
the webtable or not, then you can make use of GetRowWithCellText method
Set ObjCompare = DataTable.GetSheet(Sheetname).GetParameter("Values")
For i = 1 to 4
strDT = ObjCompare.ValueByRow(i)
rowNum = Browser("").Page("").WebTable.GetRowWithCellText(strDT)
If rowNum = -1 then
msgBox "The required value is not present in the webtable"
Else
msgBox "The required value is present in the webtable"
End If
Next
I hope this helps you
Enjoy Automation,
Shantanu
On Thursday, 7 November 2013 11:48:38 UTC+5:30, suresh jagaleti wrote:
>
> What i am asking is if web table have 4 values we need to check wether the
> web table values and datatable values are matched or nor with columns and
> rows also
> suggest me how to compare and validate web table and data table
>
--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
---
You received this message because you are subscribed to the Google Groups "QTP
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.