Hello fellow testers! Is your task switcher (Alt+Tab) getting a workout because you’re bouncing between Postman for data setup and Katalon for UI testing?
We’ve all been there: manually creating a user via API just so we can test a login flow. It’s tedious and slows down your automation suite.
The Value: In Katalon, your API calls live in the Object Repository right next to your Web elements. You can chain them! Use a WS.sendRequest to create a user, grab the response, and immediately pass that variable into a WebUI.setText command.
My Take: I’m a huge advocate for “API-First” setup. Why spend 30 seconds automating a UI registration form for every test case when a 1-second API call can prep your data? It makes your suites faster and much more stable.
How about you? Do you keep your API and UI tests in the same project, or do you prefer keeping them strictly separated? Let’s hear your strategy!
same project. the whole point is being able to mix WS and WebUI calls in a single test case without jumping through hoops. Data setup via API, assertions via UI, teardown via API. Keeping them in separate projects just forces you to manage state across boundaries, which defeats the purpose.
the pattern I use is a custom keyword for data prep that returns the created entity details, then the test case just calls that and proceeds with UI steps. Something like:
def user = CustomKeywords.'com.my.DataHelper.createUser'(['role': 'admin'])
WebUI.setText(findTestObject('Login/input_username'), user.username)
WebUI.setText(findTestObject('Login/input_password'), user.password)
the keyword handles the WS.sendRequest and response parsing so your test case stays clean and readable. You get the speed benefit without cluttering your test logic with API boilerplate.