Forum Discussion

APERRY's avatar
APERRY
Occasional Contributor
4 years ago
Solved

Remove project custom properties with TestRunner

Hello everybody,

 

I'm looking for a solution to remove custom properties from my project. 

Indeed, during an execution with the TestRunner, I save data in project custom properties and I would like delete them with a script.

This bellow script work fine when I play it with the Test Case execution, but not with the Test Runner Execution : 

 runner.project.properties.each {
if (testRunner.project.properties[it.key].name == 'XRAY-ID'){
log.info('On ne fait rien')
}
else {
if (testRunner.project.properties[it.key].name.contains('P_') == true){
testRunner.project.removeProperty(testRunner.project.properties[it.key].name)
}
}
}

This script is positionned in a Script Test Step.

 

Do you have an idea ?

 

Thank you in advance for your help,

 

Anthony

  • What is your use case.?
    If the project is run from commandline, and the property is created dynamically, then you don't have to remove it manually unless if you are using option "-s".

4 Replies