Print the values of a variable in console

i am doing data driven testing and loaded the test data in an excel and calling the values by a variable. I want to print value in console for each iteration. Please help me

Thanks

@kgprakash try


System.out.println(Your_Variable_Name)		

thanks Manpreet…tried but no luck and here is my code:
WebUI.setText(findTestObject(‘ENF123 Submissions/input_Location ID or Name_LocIdSearchString’), findTestData(“ENF-123SubmissionsTestSuite”).getValue(1, 1))

2 Likes

@kgprakash You would need to declare the variable before printing it.

Try:

Your_Variable_Name = WebUI.setText(findTestObject(‘ENF123 Submissions/input_Location ID or Name_LocIdSearchString’), findTestData(“ENF-123SubmissionsTestSuite”).getValue(1, 1))

System.out.println(Your_Variable_Name)

no luck manpreet

Can you show me the error ?

1 Like

its not showing any error and below is the code

praks = WebUI.setText(findTestObject(‘ENF123 Submissions/input_Location ID or Name_LocIdSearchString’), findTestData(“ENF123Submissions”).getValue(1, 1))

System.out.println(praks)

Hi, use

praks = findTestData("ENF123Submissions").getValue(1, 1)
WebUI.setText(findTestObject('ENF123 Submissions/input_Location ID or Name_LocIdSearchString'), praks)

println(praks)

The variable will be displayed in the console, not “log viewer”

1 Like

Thanks Helene
yes…checking in the console but no luck

Create a new TestCase with only the two lines

praks = findTestData("Name of your DataFile").getValue(1, 1)
println(praks)

and seen again the console. I’m sure it works.

1 Like

Thanks Helene. it worked now.

3 posts were split to a new topic: Katalon Studio: need to get variable values (print out in excel or notepad file)

2 posts were split to a new topic: Katalon Studio: Need to create sales invoice with for loop or any any option I have upload image