Impossible to pass a list as argument to a Test Case

I call a test case with 2 lists as arguments

data are in the lists

In the targeted Test Case input variables are well declared

Despite all this my list is empty
image

Looks to me as if the “r” and “h” references are referencing the default lists created by your variable declaration, instead of the lists you are passing in. These are initialized as empty lists (I would assume), thus the zero-size result. Let me test this on my side as well :expressionless:

I’ve got this working.

“Parent” test case:

import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase

import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

List<String> strings = new ArrayList<String>();
strings.add("Hello world.")

WebUI.callTestCase(findTestCase('child'), ['strings': strings], FailureHandling.STOP_ON_FAILURE);

“Child” test case:


System.out.println(strings.toString());

Console output upon running “Parent” test case:

SLF4J: The requested version 1.7.16 by your slf4j binding is not compatible with [1.6]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
2019-01-21 12:48:11.576 e[34mINFO e[0;39m e[36mc.k.katalon.core.main.TestCaseExecutor -e[0;39m e[39m--------------------e[0;39m
2019-01-21 12:48:11.576 e[34mINFO e[0;39m e[36mc.k.katalon.core.main.TestCaseExecutor -e[0;39m e[39mSTART Test Cases/parente[0;39m
2019-01-21 12:48:12.149 e[39mDEBUGe[0;39m e[36mtestcase.parent -e[0;39m e[39m1: strings = new java.util.ArrayList()e[0;39m
2019-01-21 12:48:12.151 e[39mDEBUGe[0;39m e[36mtestcase.parent -e[0;39m e[39m2: strings.add(“Hello world.”)e[0;39m
2019-01-21 12:48:12.182 e[39mDEBUGe[0;39m e[36mtestcase.parent -e[0;39m e[39m3: callTestCase(findTestCase(“child”), [“strings”:strings], STOP_ON_FAILURE)e[0;39m
2019-01-21 12:48:12.304 e[34mINFO e[0;39m e[36mc.k.katalon.core.main.TestCaseExecutor -e[0;39m e[39m--------------------e[0;39m
2019-01-21 12:48:12.304 e[34mINFO e[0;39m e[36mc.k.katalon.core.main.TestCaseExecutor -e[0;39m e[39mCALL Test Cases/childe[0;39m
2019-01-21 12:48:12.340 e[34mINFO e[0;39m e[36mc.k.katalon.core.main.TestCaseExecutor -e[0;39m e[39mstrings = [Hello world.]e[0;39m
2019-01-21 12:48:12.356 e[39mDEBUGe[0;39m e[36mtestcase.child -e[0;39m e[39m1: out.println(strings.toString())e[0;39m
[Hello world.]
2019-01-21 12:48:12.388 e[34mINFO e[0;39m e[36mc.k.katalon.core.main.TestCaseExecutor -e[0;39m e[39mEND CALL Test Cases/childe[0;39m
2019-01-21 12:48:12.388 e[34mINFO e[0;39m e[36mc.k.katalon.core.main.TestCaseExecutor -e[0;39m e[39m--------------------e[0;39m
2019-01-21 12:48:12.404 e[34mINFO e[0;39m e[36mc.k.katalon.core.main.TestCaseExecutor -e[0;39m e[39mEND Test Cases/parente[0;39m

1 Like

Weird, sometimes it works sometimes not… Let’s say it’s on my side until I understand what is happening

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.