How to record/playback and play the script starting from within a login session

Hi,

When I record/playback after login in to my web portal, I am required to include the login steps within my script if i want to play back the script. I believe this is the case because the browser that Katalon uses does not keep cashed sessions.How do i bypass this? Since i already have a login script/test case, I wouldnt want to include that part of the script in other scripts. I should be able to run the whole test suite or run scripts independently. How is this achieved with Katalon Studio? Many thanks!!

I have ever tried it but was unsuccessful. See the following post.


I am afraid that it would be a waste of time for you to try to “bypass login process”.

If you have a login script already, you can automate the login process and can repeat it easily, can’t you?

You want to modularise your test scripts. Use WebUI.callTestCase keyword.

You can create 3 test case scripts:

  • Test Cases/login
  • Test Cases/case1
  • Test Cases/case2

The case1 script would be something like this:

WebUI.openBrowser('...')
WebUI.callTestCase('TestCases/login')
// do whatever needed in the case1
WebUI.closeBrowser()

The case2 script would be something like this:

WebUI.openBrowser('...')
WebUI.callTestCase('TestCases/login')
// do whatever needed in the case2
WebUI.closeBrowser()

Thus you can repeat calling the login script in both of the case1 and case2. You do not have to manually copy&paste the login code into the caller scripts.

I agree with that and have done that. But if i then decide to run the whole thing in a suite, it would unecessarily repeat the Test Cases/login part, adding test time to run. I would have to disable that part in each script.

@mgrandillo

Is it OK if I close this topic?

Yes. I have a much bigger problem that noone is commenting on. I get a black monitor sometimes when I spy on an object, and/or record a test. The only workaround is to reboot the PC. Has anyone encountered this? Note that I am not using the payed version yet but this would definitely be a deal breaker since it happens often and is quite annoying.

This?

1 Like