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))

1 Like

@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 ?

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”

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.

Thanks Helene. it worked now.