Ejemplo n.º 1
0
def VerifySorting(strColumnName):
    columnIndex = GetColumnIndexByName(strColumnName)
    WebObjsSort = Users.Sort(columnIndex)

    WebObjsSort.Click()
    Waiter.Wait(3)
    strAsc = WebObjsSort.getAttribute('class')

    strFirstRecord = Users.FirstRecord(columnIndex).contentText
    strLastRecord = Users.LastRecord(columnIndex).contentText

    WebObjsSort.Click()
    Waiter.Wait(3)
    strDesc = WebObjsSort.getAttribute('class')

    strFirstRecord2 = Users.FirstRecord(columnIndex).contentText  #textContent;
    strLastRecord2 = Users.LastRecord(columnIndex).contentText  #textContent;

    Log.Message("Order By: {" + strColumnName + " " + strAsc +
                "} First Value: {" + strFirstRecord + "}, Last Value: {" +
                strLastRecord + "}")
    Log.Message("Order By: {" + strColumnName + " " + strDesc +
                "} First Value: {" + strFirstRecord2 + "}, Last Value: {" +
                strLastRecord2 + "}")

    Logger.CheckPoint("Validate Sorting On Column {" + strColumnName +
                      "} . Pass") if (
                          strFirstRecord == strLastRecord2
                          and strLastRecord == strFirstRecord2
                      ) else Log.Error("Validate Sorting On Column {" +
                                       strColumnName + "}. Failed")