How can I create a Java Class in Katalon?

I have a scenario where I need to pass Random Test Data in the text fields
To achieve this in Java (not in Katalon), I've created Random Text Generator class with few methods like getRandomName, getRandomCity, getRandomPhoneNumber.

How can I achieve the same in Katalon, I want to pass this random text instead of using Test Data from internal/external files

Comments

  • You don't need .java file. Just call a custom keyword (see previous post), save it into a variable and pass the variable into setText() method.

    def randomString = CustomKeywords.'seleniumKeyword.exampleKeyword.getSaltString'()

    WebUI.setText(findTestObject(/your/text/field/object), randomString)
Sign In or Register to comment.