Problem Analysis
You’re experiencing a mobile app session disconnection during test execution—the app disappears mid-test, causing “Element Not Found” errors. This is a known issue in Katalon mobile testing with several root causes related to driver state management, Appium process issues, and improper wait strategies.
The key insight from Katalon’s official troubleshooting documentation is that repeatedly starting and stopping the application can put the driver in a bad state, which directly matches your symptom of the app vanishing at the same spot repeatedly.
Root Causes & Solutions
1. Driver State Corruption (Most Likely)
Problem: Repeated app restarts corrupt the Appium driver session.
Solution: Restructure your test suite to start the app once at the beginning and stop it once at the end:
// ❌ WRONG - Causes driver corruption
Test 1: Mobile.startApplication() → Test steps → Mobile.closeApplication()
Test 2: Mobile.startApplication() → Test steps → Mobile.closeApplication()
// ✅ CORRECT - Maintains driver state
Test Suite:
Mobile.startApplication() // Start ONCE
Test 1: Test steps
Test 2: Test steps
Mobile.closeApplication() // Stop ONCE
Reference: Katalon Documentation - “No Driver Found” Error
2. Stale Appium Processes
Problem: Appium processes don’t quit completely, interfering with new test runs.
Solution: Before running tests, check and kill stale Appium processes:
# macOS/Linux
ps aux | grep appium
kill -9 <process_id>
# Windows
tasklist | findstr appium
taskkill /PID <process_id> /F
Then verify your Appium directory is correctly set:
- macOS:
usr/local/lib/node_modules/appium
- Windows:
C:\npm\node_modules\appium
Navigate to Preferences > Katalon > Mobile to confirm the path.
3. Insufficient Wait Strategies (Your Current Issue)
Problem: WebUI.delay(10) doesn’t actually wait for element readiness—it just pauses. If the app crashes or becomes unresponsive, the delay won’t help.
Solution: Replace static delays with mobile wait keywords that check for actual element readiness:
// ❌ WRONG - Static delay doesn't check element state
WebUI.delay(10)
Mobile.tap(findTestObject('dashboard_element'), 0)
// ✅ CORRECT - Waits for element to be present AND visible
Mobile.waitForElementPresent(findTestObject('dashboard_element'), 30)
Mobile.waitForElementVisible(findTestObject('dashboard_element'), 30)
Mobile.tap(findTestObject('dashboard_element'), 0)
Available Mobile Wait Keywords:
Mobile.waitForElementPresent() - Waits for element to exist in DOM
Mobile.waitForElementVisible() - Waits for element to be visible
Mobile.waitForElementNotPresent() - Waits for element to disappear
Reference: Mobile Wait Keywords Documentation
4. Device/Emulator Resource Issues
Problem: The device or emulator may be running out of memory or experiencing background interference.
Solution:
- Close unnecessary background apps on the device
- Restart the emulator/device before running tests
- Check device memory:
adb shell dumpsys meminfo
- For emulators, allocate more RAM in AVD settings
Recommended Action Plan
- Immediate: Kill all stale Appium processes and verify your Appium directory path
- Short-term: Restructure your test suite to start/stop the app once per suite, not per test
- Long-term: Replace all
WebUI.delay() calls with proper Mobile.waitForElement*() keywords
- Verify: Run your test again and monitor the Console tab to confirm Appium starts cleanly and the driver remains active throughout
References