First test case in test suite only passes

my last push code was on april 2025 then the run in testops is running smoothly without error. Suddenly my Test Suites are having errors last week(May 14). it only passes the first test case of the test suite. The succeeding test cases are failed. It only navigates to the URL. then it closes after navigating to URL

Why this is happening? i have no code changes last May 14.
This error happens when run in Katalon Testops Agent but when i run it in my local, it passes

1 Like

The issue where only the first test case passes in TestOps Agent executions (while working locally) is often caused by environment-specific mismatches or resource contention. Here’s how to diagnose and fix it:


1. Browser/Driver Version Mismatch

  • Problem: TestOps Agent may have auto-updated Chrome/Edge, causing incompatibility with your project’s driver.
  • Fix:
    1. Check browser versions on the TestOps Agent machine:

bash

google-chrome --version  # Chrome
msedge --version         # Edge
  1. Download the matching WebDriver and update Drivers folder in your Katalon project.

2. Residual Browser/Driver Processes

  • Problem: Browsers/drivers from the first test aren’t fully terminated, blocking subsequent tests.
  • Fix:
    • Add cleanup code to your @AfterTestCase method:

groovy

@AfterTestCase
def closeBrowser() {
  if (WebUI.getBrowserName() != null) {
    WebUI.closeBrowser()
  }
  // Kill lingering processes (Windows example)
  Runtime.getRuntime().exec("taskkill /f /im chromedriver.exe /t")
}

3. Insufficient Agent Resources

  • Problem: Low RAM/CPU on the TestOps Agent machine causes timeouts after the first test.
  • Fix:
    • Monitor resource usage during execution (e.g., top on Linux).
    • Increase Agent machine specs or limit parallel executions:

bash

# In TestOps Agent config (config.json)
{
  "maxParallelExecutions": 1  # Reduce concurrency
}

4. Headless Mode Configuration

  • Problem: Headless arguments conflict in cloud/agent environments.
  • Fix: Update Chrome args in your project’s execution.properties:

text

webui.chrome.args="--no-sandbox;--disable-dev-shm-usage;--headless=new;--remote-debugging-port=9222"

5. Test Case Dependency

  • Problem: First test case may leave the browser in a state that breaks subsequent cases.
  • Fix:
    • Ensure each test case is independent (use @BeforeTestCase to reset state):

groovy

@BeforeTestCase
def setup() {
  WebUI.openBrowser('')
  WebUI.setViewPortSize(1920, 1080)
}

6. Debugging via Logs

  • Check TestOps Execution Logs for errors after the first test:
    1. Look for WebUI.verifyElementPresent failed or NoSuchWindowException.
    2. If you see Chrome not reachable, it confirms browser crashes.

7. Revert Recent Environment Changes

  • If the issue started on May 14 without code changes:
    1. Roll back TestOps Agent to a prior version.
    2. Check for OS updates/patches applied around May 14 on the Agent machine.
    3. Verify network/firewall rules haven’t blocked ports used by Katalon.

Summary of Fixes (Prioritized)

  1. Update WebDriver to match TestOps Agent’s browser version.
  2. Force browser/driver cleanup after each test case.
  3. Run tests sequentially to isolate resource issues.

Example Fix Workflow:

groovy

// Test Case 1
WebUI.openBrowser('')
WebUI.navigateToUrl('https://your-app.com/login')
// Test steps...
WebUI.closeBrowser()  // Explicit close

// Test Case 2
WebUI.openBrowser('') // Re-initialize browser
WebUI.navigateToUrl('https://your-app.com/dashboard')

issue resolved ??

Sorry for incorrect info, I run this Katalon TestCloud. What should I do

Hi @cagus,

Do you still not succeed running your code now? Can you please help give us the error log or step to reproduce, your code if possible so that we can better support? Thank you

can you share the full error trace? is it failing only in test cloud? if you ran the same suite locally, all tests passes?

Here is the error log. This is only failing in Test Cloud. All test passes when run locally.

06/05/2025 10:22:35 +08:00 - [TEST_CASE][FAILED] - Start Test Case : SCENARIO Adding Webpage file in Attachment tab: SCENARIO Adding Webpage file in Attachment tab FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Call Test Case 'Test Cases/Common/Sign In' failed
	at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:63)
	at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.call(CallTestCaseKeyword.groovy)
	at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:75)
	at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.callTestCase(CallTestCaseKeyword.groovy:81)
	at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.execute(CallTestCaseKeyword.groovy:44)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
	at com.kms.katalon.core.keyword.BuiltinKeywords.callTestCase(BuiltinKeywords.groovy:310)
	at redmap.npbp.stepDefintions.RED_T111.I_can_login_to_the_system_using_this_credentials(RED_T111.groovy:185)
	at ✽.I can navigate to dev using this credentials expc1@ldsqa.com and 1JS52vWP5IQI6YZ/gdTNjQ==(/work/test-project/109146/Include/features/Redmap5/Streaming of files in Attachments tab/RED-465 Adding Webpage file in Attachment tab.feature:5)
Caused by: com.kms.katalon.core.exception.StepFailedException: Unable to click on object 'Object Repository/Page_Login - Redmap 5/input_Continue'
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.click(ClickKeyword.groovy:74)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:40)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:620)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$4.call(Unknown Source)
	at Sign In.run(Sign In:38)
	at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
	at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:448)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:144)
	at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:59)
	at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.call(CallTestCaseKeyword.groovy)
	at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:75)
	at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.callTestCase(CallTestCaseKeyword.groovy:81)
	at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.execute(CallTestCaseKeyword.groovy:44)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
	at com.kms.katalon.core.keyword.BuiltinKeywords.callTestCase(BuiltinKeywords.groovy:310)
	at redmap.npbp.stepDefintions.RED_T111.I_can_login_to_the_system_using_this_credentials(RED_T111.groovy:185)
	at cucumber.runtime.Utils$1.call(Utils.java:26)
	at cucumber.runtime.Timeout.timeout(Timeout.java:16)
	at cucumber.runtime.Utils.invoke(Utils.java:20)
	at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:48)
	at cucumber.runtime.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:50)
	at cucumber.runner.TestStep.executeStep(TestStep.java:70)
	at cucumber.runner.TestStep.run(TestStep.java:52)
	at cucumber.runner.PickleStepTestStep.run(PickleStepTestStep.java:53)
	at cucumber.runner.TestCase.run(TestCase.java:47)
	at cucumber.runner.Runner.runPickle(Runner.java:44)
	at cucumber.runtime.Runtime.runFeature(Runtime.java:120)
	at cucumber.runtime.Runtime.run(Runtime.java:106)
	at cucumber.api.cli.Main.run(Main.java:35)
	at cucumber.api.cli.Main$run.call(Unknown Source)
	at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$_runFeatureFile_closure1.doCall(CucumberBuiltinKeywords.groovy:108)
	at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$_runFeatureFile_closure1.doCall(CucumberBuiltinKeywords.groovy)
	at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:75)
	at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:69)
	at com.kms.katalon.core.keyword.internal.KeywordMain$runKeyword.call(Unknown Source)
	at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords.runFeatureFile(CucumberBuiltinKeywords.groovy:75)
	at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$runFeatureFile$0.callStatic(Unknown Source)
	at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords.runFeatureFile(CucumberBuiltinKeywords.groovy:248)
	at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$runFeatureFile.call(Unknown Source)
	at RED-465 Adding Webpage file in Attachment tab.run(RED-465 Adding Webpage file in Attachment tab:20)
	at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
	at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:448)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
	at com.kms.katalon.core.common.CommonExecutor.accessTestCaseMainPhase(CommonExecutor.java:65)
	at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:148)
	at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:106)
	at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:187)
	at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
	at TempTestSuite1749089955520.run(TempTestSuite1749089955520.groovy:36)
Caused by: org.openqa.selenium.WebDriverException: An unknown error has occurred
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '125937winchrome136-11365178-katalon-agent-457tw', ip: '10.50.43.136', os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.115', java.version: '1.8.0_382'
Driver info: com.kms.katalon.selenium.driver.CRemoteWebDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 136.0.7103.114, chrome: {chromedriverVersion: 136.0.7103.114 (cedfcc36d43..., userDataDir: C:\Program Files (x86)\scop...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:9225}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
Session ID: 2e2cb3d6a0366364832d2fadd1279c02
*** Element info: {Using=xpath, value=//input[@type = 'button' and @id = 'Continue']}
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
	at com.kms.katalon.selenium.driver.CRemoteWebDriver.execute(CRemoteWebDriver.java:30)
	at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:353)
	at org.openqa.selenium.remote.RemoteWebDriver.findElementsByXPath(RemoteWebDriver.java:432)
	at org.openqa.selenium.By$ByXPath.findElements(By.java:348)
	at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:311)
	at org.openqa.selenium.support.events.EventFiringWebDriver.***$new$1(EventFiringWebDriver.java:105)
	at com.sun.proxy.$Proxy17.findElements(Unknown Source)
	at org.openqa.selenium.support.events.EventFiringWebDriver.findElements(EventFiringWebDriver.java:182)
	at com.kms.katalon.core.webui.common.WebUiCommonHelper.findElementByNormalMethods(WebUiCommonHelper.java:1027)
	at com.kms.katalon.core.webui.common.WebUiCommonHelper.findElementsBySelectedMethod(WebUiCommonHelper.java:913)
	at com.kms.katalon.core.webui.common.WebUiCommonHelper.findElementsBySelectedMethod(WebUiCommonHelper.java:901)
	at com.kms.katalon.core.webui.common.WebUiCommonHelper.findElementsBySelectedMethod(WebUiCommonHelper.java:896)
	at com.kms.katalon.core.webui.common.WebUiCommonHelper.findElementsByDefault(WebUiCommonHelper.java:892)
	at com.kms.katalon.core.webui.common.WebUiCommonHelper.findElementsWithSelfHealing(WebUiCommonHelper.java:737)
	at com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElements(WebUiCommonHelper.java:718)
	at com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElement(WebUiCommonHelper.java:1376)
	at com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword.findWebElement(WebUIAbstractKeyword.groovy:27)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy:65)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.call(ClickKeyword.groovy)
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
	... 59 more

does this work locally