diff --git a/src/main/java/com/devoteam/srit/xmlloader/core/operations/basic/OperationFunction.java b/src/main/java/com/devoteam/srit/xmlloader/core/operations/basic/OperationFunction.java index a04289246..9a40e483c 100755 --- a/src/main/java/com/devoteam/srit/xmlloader/core/operations/basic/OperationFunction.java +++ b/src/main/java/com/devoteam/srit/xmlloader/core/operations/basic/OperationFunction.java @@ -69,6 +69,13 @@ else if (file != null && name == null) { } public static void importFile(String file, URI relativeTo) throws Exception { + + // Solve user_home value + if (file.contains("[user_home]")) { + String userHome = System.getProperty("user.home"); + file = file.replace("[user_home]", userHome); + } + // parse the xml file XMLDocument scenarioDocument = Cache.getXMLDocument(relativeTo.resolve(file), URIFactory.newURI("../conf/schemas/scenario.xsd")); diff --git a/src/main/java/com/devoteam/srit/xmlloader/core/operations/basic/OperationGroovy.java b/src/main/java/com/devoteam/srit/xmlloader/core/operations/basic/OperationGroovy.java index 9432fe180..b886bb4e7 100755 --- a/src/main/java/com/devoteam/srit/xmlloader/core/operations/basic/OperationGroovy.java +++ b/src/main/java/com/devoteam/srit/xmlloader/core/operations/basic/OperationGroovy.java @@ -91,6 +91,12 @@ public Operation execute(Runner runner) throws Exception { // retrieve the list of groovy files to load String groovyFiles = getRootElement().attributeValue("name"); + // Solve user_home value + if (groovyFiles.contains("[user_home]")) { + String userHome = System.getProperty("user.home"); + groovyFiles = groovyFiles.replace("[user_home]", userHome); + } + // retrieve the groovy operation script source String scriptSource = getRootElement().getText();