Hi All,
Some time in application we have to verify the sorting functionality.In Web table for each column we need to click and check is it working fine or not. Here i am giving an example of sorting the date column. but it will verify in ascending order.
logic for this:
1. Click on Date column which sort the date in ascending order.
2. Get first row and second row date value form Date column
3. Check first row date should be less than or equal to second row date.
4. Get second row and third row date value.
5. Check second row date should be less than or equal to third row date value.
6. Same way check until end of row using For Loop.
7. In the case if you got false result while comparison two row you need to break the for loop and show the fail result......
2. Get first row and second row date value form Date column
3. Check first row date should be less than or equal to second row date.
4. Get second row and third row date value.
5. Check second row date should be less than or equal to third row date value.
6. Same way check until end of row using For Loop.
7. In the case if you got false result while comparison two row you need to break the for loop and show the fail result......
TableRowcount = Browser(“XYZ”).Page(“WXY”).WebTable(“MNP”).RowCount
For i =1 to TableRowcount -1
dtmCurrRow = TableObject.GetcellData(i,<DateColumn>)
dtmNextRow = = TableObject.GetcellData(i+1,<DateColumn>)
If NOT cdate(dtmCurrRow) <= cdate(dtmNextRow) Then
msgbox "Pass"
Else
msgbox "Fail"
End if
If NOT cdate(dtmCurrRow) <= cdate(dtmNextRow) Then
Flage = 1
Exit For
End If
End
If Flage <> 1 thanExit For
End If
End
msgbox "Pass"
Else
msgbox "Fail"
End if