Tôi muốn chạy testsuite có nhiều testcase nhưng ko muốn chạy lại bước login nhiều lần thì cần làm thế nào, katalon v10 có tính năng nào như thế không, nếu có thì cần cấu hình như thế nào, cho tôi xin các bước cụ thể với ạ
Please use https://translate.google.com/ to English before posting.
Let me kindly assist haicass98 here: “I want to run a test suite with many test cases but avoid repeating the login step multiple times, how can I do that? Does Katalon v10 have a feature for this? If yes, how do I configure it? Please provide the specific steps.” ![]()
Thanks for your help Mr Kazu ![]()
I run all my test cases by using test suites and I think you should too. Unfortunately, I don’t think Katalon has any specific feature to turn code on or off.
However, if you have a couple of ways to set your test cases to start, like to login or not, I might use an ‘if’ statement to indicate a section that should run under one condition but not another. So, perhaps you can create a Global Variable that is your indicator (or condition), like “gRunAll” and set the variable to either true or false to indicate you want to run all your test cases without login or not. You could even add a test case that only has the variable set to true or false, like:
GlobalVariable.gRunAll = true
and then does your one-time login. You would include this test case at the beginning of your test suite for all your test cases that you want to run without running your login routine. You should create this variable in your “default” profile and set it a value of “false”. Unfortunately, you would have to make changes to all your test cases to have your login routine bypassed if you are running like this.
if (!GlobalVariable.gRunAll) {
your login routine
}
There are applications that allow you to do group “find and replace” to your Katalon code, so you might want to look into this, so you don’t have to make changes one by one.
Katalon provides a sample project “Healthcare”:
This project has a Test Case named “Login”:
Please read the Test Case scripts of the sample.
Alternatively, you can use a built-in keyword “CallTestCase”:
Using the “CallTestCase” keyword, your testcase scripts can call the shared “Login” test case as a subroutine. The “CallTestCase” keyword enables to control the login procedure at minute level.
Possibly @haicass98 wants to try “CallTestCase”.