Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Code condensing
#1
Not Solved
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.
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
Reply


Messages In This Thread
Code condensing - by joncfrazier - 05-15-2012, 10:07 PM
RE: Code condensing - by Shridevi.Salagare - 05-16-2012, 12:26 PM
RE: Code condensing - by joncfrazier - 05-16-2012, 07:58 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)