From within a Groovy script step in the test case:
def propList = []
testRunner.testCase.getPropertyList().each { prop ->
pmap.add(prop.name)
}
def sortedList = propList.sort()
def index = 0
sortedList.each { name ->
testRunner.testCase.moveProperty(name, index++)
}
From the project Load script to sort properties in all test cases in all test suites:
project.testSuiteList.each { testSuite ->
testSuite.testCaseList.each { testCase ->
def propList = []
testCase.getPropertyList().each { prop ->
propList.add(prop.name)
}
def sortedList = propList.sort()
def index = 0
sortedList.each { name ->
testCase.moveProperty(name, index++)
}
}
}
I'm curious as to why you would want to do this.