Forum Discussion

bmgriner's avatar
bmgriner
Frequent Contributor
13 years ago

Composite Project and the Resource Directory

I have seen documentation that talks about setting up a resource directory with defaults such as ${projectDir} or ${workspaceDir}. In a composite project, however, you will also have another folder ri...
  • Nastya_Khovrina's avatar
    Nastya_Khovrina
    6 years ago

    Hi matsorm,

     

    Please see my comments below.


    matsorm wrote:

    The correct path is already in the value of the "Project property" called File, but I don't now how to refer to this property as it is not a custom property. Could this be done?


    You can use the following script to get the value:

     

    import com.eviware.soapui.impl.wsdl.WsdlProject
    def project = context.getTestCase().getTestSuite().getProject()
    log.info(project.getPath())

     

    Regarding changing the existing functionality:


    matsorm wrote:

    I think the functionality of the "Recource root: ${projectDir}" should be changed once the project is set to a composite project!


    If we change this option, this will broke existing users projects. But, maybe, we can create a new property for this.

     

    You can create a new feature request here: 

    https://community.smartbear.com/t5/ReadyAPI-Feature-Requests/idb-p/ReadyAPIFeatureRequests

     

  • matsorm's avatar
    matsorm
    6 years ago

    Thanks for the script tip!
    I added a line 

    testRunner.testCase.setPropertyValue( "ProjectDirectory", project.getPath());

     and imported it with 

    ${#[SuiteX#TestCaseX]#ProjectDirectory}/myDataFolder/myFile

     

    I would still like to see a custom property for this for composite projects, that could be used in the same manner as ${projectDir} for non composite projects, so that project members don't have to run a script before importing files.