Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
othomas-dev opened this issue Jun 19, 2023 · 0 comments

Comments

@othomas-dev
Copy link

othomas-dev commented Jun 19, 2023

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

@othomas-dev othomas-dev changed the title How to access to a "MTS list" in groovy code? MTSScript.groovy: setMTSParam method does not work properly for <List> parameters Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant