05-15-2012, 10:07 PM
(This post was last modified: 05-15-2012, 10:09 PM by joncfrazier.)
1) Is there a faster (i.e. shorter) way to accomplish this code, or is this the most condensed method?
2) Even if not more condensed, is there a better way?
3) Is there a way to compare values while ignoring empty space and being case insensitive?
The code compares text fields on a web page with values in a datatable. As the parameterized test goes down, it compares each row with the values in the text field.
Only the zprod value is entered into a text field, while the xprod value is autofilled out by the web page.
2) Even if not more condensed, is there a better way?
3) Is there a way to compare values while ignoring empty space and being case insensitive?
The code compares text fields on a web page with values in a datatable. As the parameterized test goes down, it compares each row with the values in the text field.
Only the zprod value is entered into a text field, while the xprod value is autofilled out by the web page.
Code:
xprod = Browser("...").Page("...").WebEdit("txtName").GetROProperty("value")
zprod = Browser("...").Page("...").WebEdit("txtBr").GetROProperty("value")
xprodTbl = DataTable.Value ("A",dtLocalSheet)
zprodTbl = DataTable.Value ("B",dtLocalSheet)
If xprod = xprodTbl AND zprod = zprodTbl Then
Reporter.ReportEvent micPass, "Match", "Values in field match values in Table"
Else
Reporter.ReportEvent micFail, "Don't Match", "Values in field do not match values in Table"
End If