Forum Discussion

joanaferreira's avatar
11 years ago

How to load properties to ALL projects

Hello,

Following the tutorial on Working with Properties (http://www.soapui.org/Functional-Testin ... rties.html), I've created a file in which I keep all my properties and then I manually load them to the Custom Properties.

I have about 50 projects that use the same properties file. Whenever I change the properties file I have to manually load the file for each project.

What I'm wondering is if there isn't a way to automate this procedure and automatically load the file to ALL projects...

Thanks,
Joana Ferreira

2 Replies

  • ruival's avatar
    ruival
    New Contributor
    Hi Joana,

    have you managed to find a solution to this requirement ? i'm also facing the issue of loading a set of properties to 30 projects ...

    best regards

    Rui Madaleno
  • PaulDonny's avatar
    PaulDonny
    Regular Contributor
    Well, there is multiple different possible solutions here.

    I went ahead and coded a quick groovy script that will do it though

    //Set source Project as project running the groovy script
    source = testRunner.testCase.testSuite.project;

    //Grab all of the projects in the WorkSpace
    testRunner.testCase.testSuite.project.workspace.getProjectList().each {
    //No need to add the properties to where it gets them from, right?
    if (it != source) {
    //Just a debugging/Visual feedback thing.
    log.info it.getName();
    //Going through each individual property from the source
    for (properties in source.getPropertyList()) {
    //And setting it to the projects in the .each {} loop
    it.setPropertyValue(properties.getName(),properties.getValue());
    }
    }
    }