Test Case: “Login”: Open Browser ()=> Login and so on.
Test Case: “Something after login”: click here and there.
and then I have many of these:
Test Suite: “Something beautiful”:
— Test case “Login”;
— Test case “Something after login”;
— Test case “Another one test case and so on…”
and then I have also:
Test Suite Collection: “All my test suite!”
— Test suite: “Something beautiful”
— Test suite: “Another one test suite and so on…”
What I need is that in my Test Suite Collection I can avoid every time the “Login” step (which is in every Test Suite).
Maybe also with an “if (GlobalVariable.skip_login)”.
Today also if I do one Test Suite with just “Open Browser” action the browser close itself after that step and reopen itself for the next step in Test Suite Collection.
I’m sorry Hanh Tran, but this is not a right answer for my problem.
It seems to me you don’t understand what I need to do.
The GlobalVariable in a Test Collection is reset at every Test Suite start and than the Login step is repeated. After that there is another problem: every test suite close the browser also without WebUI.closeBrowser().
So things are getting complicated. What you are trying to do will break the usual flow of test suite if you execute it separately. I suggest that each Test Suites should be independent of each other , do not try to mess it.
I can suggest you the following workaround by having ‘gl_isLogin’ variable (default is true)
if (already logged in)
{
GlobalVariable.gl_isLogin = true
}
else
{
//Not logged in yet, insert login steps below
WebUI.setText(userName)
WebUI.setText(password)
.....
}
End of ‘Login’ Test Case before you trying to close browser
Do you know any indications from your application that you’ve logged in successfully like successful login message? If so, you can add a flag in ‘Login’ test case to avoid re-executing:
Glno, I don’t know if you have solved this problem, but as far as I understand, Test collection will close the browser after every test suite. What you need here is a single test suite with multiple test cases and a LISTENER for every action you wish to perform AFTER login.
Create a listener with “Before Test Suite” and “After Test Suite” options ticked and just call the login test case and logout test case in it. Something like this
Call the “Open browser” and “Close Browser” command in login test case and logout test case respectively. The listener will prevent logging in and logging out for every test case.
This design of Katalon studio is frustrating. Katalon automation recorder has better capability here.
Let me give an example of my use case.
My team provides a web form with complex validation rules. There is a default form, and there are 10 simpler variations of it.
To test the validation of any section, all the sections above it must be populated with valid data.
I made 8 test cases for the standard form that test each section of the form in Katalon automation recorder. I run all 8 test cases within a test suite.
To test a new variation of this form:
I copy the test suite.
Then I change the URL of the first test case.
I change assertions that test the H1 and title text.
Then I remove test cases that do not apply to that form variation
And I modify other test cases, e.g. the form variations for countries hide country field and pre-populates it, so I test that the field exists, and that it is populated with the correct country.
This has worked OK for my team.
Two issues are:
parts of the validation are complex and would be easier to do with data-driven testing
we would like to use a service like browserstack to cross-browser test.
So I migrated the tests to Katalon studio to solve these issue. But the test suite will not run because the browser is closed between each test case, losing all the data in the form. If I combine all the test cases into one, then I lose modularity and the tests are much harder to re-use.