Dear Team,
I am currently working on automating a hybrid mobile application. Previously, I was utilizing WebView for this purpose; however, since upgrading to Katalon Studio version 10.x, the WebView functionality is no longer working as expected.
If anyone has encountered a similar issue or is aware of a solution, your assistance would be greatly appreciated.
Thank you for your support.
Best regards,
Nithish U
1 Like
kreno
April 21, 2025, 9:47pm
2
@nithish.u What do you mean that the WebView functionality is no longer working as expected? Does it fail to switch to the webview context? Or is it switching successfully but not seeing any objects? What is the failure you are seeing?
To address the WebView issue in hybrid apps with Katalon Studio v10 :
1. Update Desired Capabilities for Appium
Katalon Studio v10 uses Appium 8.x , which may require updated capabilities for hybrid apps.
For Android:
"appium:automationName" : "UIAutomator2",
"appium:chromedriverExecutable" : "<path_to_chromedriver>",
"appium:autoWebview" : true, // (optional)
"appium:ensureWebviewsHavePages" : true
For iOS:
"appium:automationName" : "XCUITest",
"appium:webviewConnectTimeout" : 20000,
"appium:safariIgnoreWebHostnames" : "localhost,<your-domain>"
2. Enable WebView Debugging
Ensure WebView debugging is enabled in your app:
Android : Add WebView.setWebContentsDebuggingEnabled(true);
in your app code.
iOS : Set isInspectable
to YES
for Safari debugger.
3. Context Switching
Hybrid apps require switching contexts to interact with WebView. Use:
// Get all contexts
Set<String> contexts = WebUiDriver.getDriver().getContextHandles();
// Switch to WebView context (e.g., "WEBVIEW_<package>")
WebUiDriver.switchToContext("WEBVIEW_<package_name>");
4. Chromedriver Version Mismatch
Katalon Studio v10 bundles a specific Chromedriver. Ensure it matches your device’s Chrome browser version :
Override the path in capabilities:
"appium:chromedriverExecutable" : "/path/to/correct/chromedriver"
5. Check Katalon Logs
Review logs for errors during WebView context switching. Common issues:
No such context found
: Incorrect WebView context name.
ChromeDriver not found
: Chromedriver path mismatch.
If using Android 12+ , ensure android:exported="true"
is set in your app’s manifest for WebView activities.
Troubleshooting Steps
Test WebView manually in the app to confirm it loads.
Use Appium Desktop to verify context names (e.g., WEBVIEW
or NATIVE_APP
).
Add explicit waits before switching contexts:
WebUiDriver.waitForElementPresent(findTestObject('web_element'), 30)
If the issue persists, share your:
Full desired capabilities ,
Katalon logs ,
Appium server logs .
1 Like
Thanks @kreno for your response.
Yes, it starts failing when switching to the web view context.
issue resolved?? @nithish.u
1 Like
setWebContentsDebuggingEnabled as true in android desired capabilities