How to separate login test case/steps from functional test

Hi,

I would like to have a test case for login, and have separate test cases for after logging in, this is so I can run different combinations of tests with the login.

Currently the only way of testing functionalities is to carry out all the steps after logging in.

Thanks,

1 Like

Hi Zak

Create a TestCase “LOGIN” for your login procedure. Then, create a TestCase “TEST_1” to test a piece of functionality which calls “LOGIN” as a first step using “Call Test Case”. Repeat for TestCase “TEST_2” etc.

If that doesn’t help, then perhaps I don’t understand your problem correctly.

See: https://docs.katalon.com/display/KD/Call+test+case

3 Likes

Zak Shaikh said:

Hi,

I would like to have a test case for login, and have separate test cases for after logging in, this is so I can run different combinations of tests with the login.

Currently the only way of testing functionalities is to carry out all the steps after logging in.

Thanks,

you can easily reuse earlier prepared cases (like Login etc.)
1. Create Login case
2. Create next case and select Login case in the “Recent Keywords - Call Test Case” form
https://gyazo.com/0c641f3a61322a2504508339f51f5ded

3 Likes

Thanks guys I figured out how to do it, however I simply press the ‘add’ button in test suites to add a test case, I don’t use the Call Test Case. Can someone explain what the difference is, if there is one?

how to pass parameters between the test cases.
To elaborate,
Step1: login test case
Step2: API call. This requires a value which is coming from step1

laxminarayana said:

how to pass parameters between the test cases.
To elaborate,
Step1: login test case
Step2: API call. This requires a value which is coming from step1

You could use a GlobalVariable: https://docs.katalon.com/display/KD/Variable+Types

You need to create the GlobalVariable in the relevant execution profile -
see https://docs.katalon.com/pages/viewpage.action?pageId=13697476

In Step 1, your login test case, set your global variable to the value you need. In step 2 you can retrieve it again and use it.