katalon-studiokatalon

Call a method from default package in katalon


I have created a default class file for handling the xpath under default package,

public class TestObjectHelper {
    /*
     * TestObjectHelper will help the user to handle dynamic xpath
     */
    public static TestObject getTestObjectWithXpath(String xpath) {

        return new TestObject().addProperty('xpath', ConditionType.EQUALS, xpath)
    }
}

enter image description here

I want to use it another package, but it is not identifying the above method.

enter image description here

import statement

enter image description here


Solution

  • You need to call the function the following,

    import TestObjectHelper
    

    or suggest to move this under a separate package let's call it as com.utilites

    import com.utilites.TestObjectHelper