Forum Discussion
PaulDonny
10 years agoRegular Contributor
def password = "password1"
def username = "username1"
for (testSuite in testRunner.testCase.testSuite.project.getTestSuiteList()) {
for (testCase in testSuite.getTestCaseList()) {
for (testStep in testCase.getTestStepList()) {
testStep.setPropertyValue("Password",password)
testStep.setPropertyValue("Username",username)
log.info testStep.name +" password has been set to "+testStep.getPropertyValue("Password")
log.info testStep.name +" username has been set to "+ testStep.getPropertyValue("Username")
}
}
}
This will set the username and password for all requests within a project. Is there a better way? Probably. But this will at least get you going plus give you some simple for loops in groovy to use in the future.
Related Content
- 2 months agoStoplight
- 4 years agoAsadGilani
Recent Discussions
- 3 days agoemoya
- 3 days agoMyBalanceNow