Understand Katalon logic behaviour

Hi all

Probably I don’t understand corretly all the possibilities of Katalon sw, because I am preparing many test cases that start with the same login steps.

For example: If you have to test many areas inside a website that require a login, what is the right solution to follow? Perhaps:

  1. create a test cases with login steps only
  2. create the other test cases starting after the login
  3. merge together in a test suite

If previuos steps are corrects, how can I start to record the test cases after login without perform the login steps during the recording ?

Regards
Marco

Hi @marco.borsani

The first approach sounds good to me. Create a log-in test case and then re-use it with CallTestCase keyword. At the end of this test case you’d probably want to leave the browser opened (i.e not include closeBrowser step).

In a new test case you just need to add a step with CallTestCase calling the log-in test case and use the Web Recorder to execute that step. At the end of the execution the browser is still open, and you can continue recording from that screen.

Hope that helps !

1 Like

OK, I am using this feature.
It is ok

Thanks

1 Like

Another similar aproach to this is the page object pattern. I mean to define 3 methods :
-one method to enter username (passing username)
-one method to enter password (passing password)
-one method lo click con sign in button (for example)

then you create a wrapper method to call this 3 methods and yo can call it : loginUser
and you pass to this method username and password as : loginUser(username,password).
so in any test you can call this customKeyword.

In conclusion you can define this wrapper methods to keep it simple , reuse code and for better maintenaince as well. you can search page object pattern based on page components methods