From edc5d32918069ecc3732deb144707f4883f19547 Mon Sep 17 00:00:00 2001 From: vanshaj_aqua Date: Fri, 9 Feb 2024 18:01:51 +0530 Subject: [PATCH] Added code to update the target HOST based on HOST/host global variable --- src/main/java/com/coreyd97/stepper/step/Step.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/coreyd97/stepper/step/Step.java b/src/main/java/com/coreyd97/stepper/step/Step.java index 9549a2f..5868861 100644 --- a/src/main/java/com/coreyd97/stepper/step/Step.java +++ b/src/main/java/com/coreyd97/stepper/step/Step.java @@ -108,7 +108,14 @@ public StepExecutionInfo executeStep() throws SequenceExecutionException { public StepExecutionInfo executeStep(List replacements) throws SequenceExecutionException { byte[] requestWithoutReplacements = getRequest(); byte[] builtRequest; - + // Check if HOST/host Global variable is present if yes then update the target + for(StepVariable var : replacements) { + if (var.getIdentifier().contains("HOST") || var.getIdentifier().contains("host")) { + if(var.getValue() != null){ + this.setHostname(var.getValue()); + } + } + } this.variableManager.updateVariablesBeforeExecution(); for (StepExecutionListener executionListener : this.executionListeners) {