TestSuite execution failed

Hello All, i am new to katalon and due to strict project deadline, i really need to catch up so that i can finished the proof of concept in due time. I have open 3 to 4 threads and i know i have not provide sufficient information, i apologize for this.

It would be grateful if someone could help me to find a solution for my problem.

My problem is as follows:

I have 2 testcases in a testsuite.
-- testcase 1 is a login
-- testcase 2 creation of a user

My data are being retrieved from an excel sheet and i have 3 rows in the excel file.

Expected Behavior: 1st row in excel should be executed by doing the login and creation of a user
Then, next rows, login again and create a user, etc (till end of file)

Actual Behavior : During the execution, the login is being executed 3 times and creation of user only 1 time.

How can i solved this problem?

If you want more information. kindly let me know.

Capture 1.PNG

Capture 2.PNG

Please, share the code for the two Test Cases in question:

1. Double click each of the test cases under Tests Explorer/ Test Cases (on the left hand side)
2. Click the script tab (under the test case window)
3. Copy the script and paste it here.

Hi Ziyaad,

Can you try this?

Add all the 3 test cases separately in a test suite.

1. Login User
2. Create a user
3. XXXX

for each test case set the data using data binding.

In Data Binding> Test Data click on Data Iteration tab

You will find some this like this. Use 2nd or 3rd option and then try.

Data.PNG

Mate Mrse said:

Please, share the code for the two Test Cases in question:

1. Double click each of the test cases under Tests Explorer/ Test Cases (on the left hand side)
2. Click the script tab (under the test case window)
3. Copy the script and paste it here.

Testcase: Login Code

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint

import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase

import static com.kms.katalon.core.testdata.TestDataFactory.findTestData

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint

import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile

import com.kms.katalon.core.model.FailureHandling as FailureHandling

import com.kms.katalon.core.testcase.TestCase as TestCase

import com.kms.katalon.core.testdata.TestData as TestData

import com.kms.katalon.core.testobject.TestObject as TestObject

import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

import internal.GlobalVariable as GlobalVariable

WebUI.openBrowser(‘’, FailureHandling.STOP_ON_FAILURE)

WebUI.navigateToUrl(Login, FailureHandling.STOP_ON_FAILURE)

WebUI.setText(findTestObject(‘Memority_V1/Login/Page_Memority/input_Memority Connection_user’), Username)

WebUI.click(findTestObject(‘Memority_V1/Login/Page_Memority/input_Memority Connection_butt’))

WebUI.setText(findTestObject(‘Memority_V1/Login/Page_Memority/input_User Name_IDToken2’), Password)

WebUI.click(findTestObject(‘Memority_V1/Login/Page_Memority/input_User Name_Login.Submit’))

**Testcase: Create User
**

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint

import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase

import static com.kms.katalon.core.testdata.TestDataFactory.findTestData

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import com.kms.katalon.core.annotation.Keyword as Keyword

import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint

import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile

import com.kms.katalon.core.model.FailureHandling as FailureHandling

import com.kms.katalon.core.testcase.TestCase as TestCase

import com.kms.katalon.core.testdata.TestData as TestData

import com.kms.katalon.core.testobject.TestObject as TestObject

import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

import internal.GlobalVariable as GlobalVariable

import org.openqa.selenium.Keys as Keys

//added to generate random string

import org.apache.commons.lang.RandomStringUtils as RandomStringUtils

import java.text.SimpleDateFormat as SimpleDateFormat

WebUI.click(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test/a_Internal’))

WebUI.waitForElementVisible(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test/a_Create an internal identity’),30)

WebUI.click(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test/a_Create an internal identity’))

/** START

The code below is to generate random string

*/

String charset = (‘A’…‘Z’)

Integer length = 5

def randomString = RandomStringUtils.random(length, charset.toCharArray())

//println(randomString)

/** END

The code below is to generate random string

*/

WebUI.setText(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test Create an in/input_HR Identifier_USER_HR_ID’), randomString)

WebUI.selectOptionByValue(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test Create an in/select_MrMrsMademoiselle’), identity_title, true)

WebUI.setText(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test Create an in/input_Name_ManageLastName’), identity_lastname)

WebUI.setText(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test Create an in/input_First name_ManageFirstNa’), identity_firstname)

def mydate = new Date()

formattedDate = mydate.format(‘MM/dd/yyyy’)

WebUI.setText(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test Create an in/input_Contract starting date_V’), formattedDate)

WebUI.click(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test Create an in/input_Department_action_Browse’))

WebUI.setText(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test Create an in/input_Search an organization_S’), identity_organisation)

WebUI.click(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test Create an in/input_Search an organization_a’))

WebUI.click(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test Create an in/button_Select’))

WebUI.selectOptionByValue(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test Create an in/select_CDICDDSTAGIAIRE’), identity_contracttype, true)

WebUI.click(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test Create an in/input_The Shadow Organizations’))

WebUI.setText(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test Create an in/input_Search an organization_S’), identity_organisation)

//Start Parametrised checkbox and test object

WebUI.check(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test Create an in/input_Europe (EUROPE)_Organiza_1’))

//(2…5).each

//WebUI.check(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test Create an in/chk_shadow_organisation’,

// [(‘index’) : it]))

//End Parametrised checkbox and test object

WebUI.click(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test Create an in/button_Select’))

WebUI.clearText(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test Create an in/input_Password_ValidatePasswor’))

WebUI.setText(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test Create an in/input_Password_ValidatePasswor’), identity_password)

WebUI.click(findTestObject(‘Memority_V1/Create Internal Identity/Page_Memority QA Test Create an in/button_Submit’))

Sudheer D J said:

Hi Ziyaad,

Can you try this?

Add all the 3 test cases separately in a test suite.

1. Login User
2. Create a user
3. XXXX

for each test case set the data using data binding.

In Data Binding> Test Data click on Data Iteration tab

You will find some this like this. Use 2nd or 3rd option and then try.

Hello Sudheer, I have tried but still not working as expected :frowning:

This feature is not originally supported in Katalon Studio, where all the test case in test suites are independent to each others.
An option you can use is create another test case, add these test case into it as steps. Finally use this test case in test suite with data-driven approach.