Skip to content

MTSScript.groovy: setMTSParam method does not work properly for <List> parameters #64

@othomas-dev

Description

@othomas-dev

Hello @mjezequel, @egwepas, all,

It seems that the "setMTSParam" method does not work properly for parameters.
As you can see below, only the last value in the list is assigned to the parameter:

<?xml version="1.0" encoding="UTF-8"?>

<scenario>

	<parameter name="[myParam]" operation="set" value="paramValue"/>

	<parameter name="[myList]" operation="list.set" value="value1"/>
	<parameter name="[myList]" operation="list.addLast" value="[myList]" value2="value2"/>
	<parameter name="[myList]" operation="list.addLast" value="[myList]" value2="value3"/>

	<log level="DEBUG">myParam >> [myParam]</log>
	<log level="DEBUG">myList >> [myList]
	</log>
	
	<!-- 
	**Output:**
	myParam >> paramValue
	myList >> value1
	myList >> value2
	myList >> value3
	-->
	
	<groovy>
		groovy_myParam = getMTSParamList("[myParam]")
		groovy_myList = getMTSParamList("[myList]")
		
		groovy_myParam = "updatedValue"
		groovy_myList = ["value4", "value5", "value6"]

		setMTSParam("[myParam]", groovy_myParam)
		setMTSParam("[myList]", groovy_myList)

	</groovy>
	
	<log level="DEBUG">myParam >> [myParam]</log>
	<log level="DEBUG">myList >> [myList]
	</log>
	
	<!-- 
	**Output:**
	myParam >> updatedValue
	myList >> value6
	
	**Expected behavior:**
	myParam >> updatedValue
	myList >> value4
	myList >> value5
	myList >> value6
	-->
	
</scenario>

BTW it there any other distribution list for MTS or this is the right/only place?

Regards,
Olivier

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions