Using Parameters in test objects

Hello,

We are developing our test automation framework to support testers using the UI in Katalon for the majority of the data driving. I created an object using xPath and I would like to data drive the values.

Here is the xPath://ion-row[contains(.,’$[strVisitDate}’) and contains(.,’${strFormName}’) and contains(.,’${strPatientName}’)]/…//img

How do I expose the parameters to the test case? I tried add the parameters to the object in the the test case but then I have no way to map them to variables within the test case.

Is there a tutorial on this topic that leads the user through this step by step?

Thank you,
Paul

Hello,

In order to use Test Object with parameters, here is a good tutorial. Note that you should go into script mode.
https://docs.katalon.com/katalon-studio/docs/manage-test-object.html#parameterizing-test-object

To put it in a nutshell, once you have declared your Test Object with parameters (with the xpath like you did), you can add arguments to the ‘findTestObject’ method, like this :

WebUI.click(findTestObject(‘Object Repository/yourObject’, [(‘paramName’) : p_value]))

where p_value can be a variable from your Test with a default value or any other value.

To “expose” your parameters like you said, they must be “Test Variables”.

Then, to play your test with a Data File, you can create a Test Suite, and bind your Data File with the Test (map column to variable of your test). Here is another useful tutorial :
https://docs.katalon.com/katalon-studio/tutorials/data_driven_testing.html

I hope this will help you, please do not hesitate if you have more questions