Conditions to execute Test Case on Test Suites

How can I choose to run a test case or not, depending on the data I’m using in the test suite? For example, if I have 4 users, that have a label that says what type they are, and I just want to launch the test case when they are from one of those types?

For example:

if(usertype==type) {
ThenLaunchTestCase
}

if(usertype==type) {
  WebUI.callTestCase(findTestCase("path/to/testcase"), ...)
}

https://docs.katalon.com/katalon-studio/docs/call-test-case.html

thank you but the condition causes that empty test be thrown when the condition is not met, and that is not good for the statistics

You asked how to do something using pseudocode. I gave you the answer. That’s how to call a testcase from a testcase from a condition.

If your pseudocode is in fact unrepresentative of your situation, fix it and let me know what that is.

Taking it as is, you could provide an else.

Database: I have users with labels, which explain what type they are
Test Case: Suppose it is a simple login
Problem: I want this test case to only be released for certain users. That is, if there are two users that are type developer, and the condition is that, only with those two users, ignoring the others and only launch two Test Case.

Thanks

if(usertype==type) {
  WebUI.callTestCase(findTestCase("path/to/testcase"), ...)
} else {
  KeywordUtil.markPassed("Not relevant type")
}

but, with this code launch all the test :frowning:

Thanks

Hi can i do something like SELECT * FROM UserMNG WHERE type = @GlobalVariable.type?

*type: base data column
*GlobalVariable.type: GlobalVariable to control enviroment changes

Conversation continues here: