Error : Cannot find any WEBVIEW to switch to for testing in IOS simulator

Hi everyone ,

I am trying to run an automated test in IOS simulator that needs to switch to web view in specified page.
it works fine for Android Emulator but not working for ios simulator .

I have error for code :

Mobile.switchToWebView()

I would appreciate for any help!!


tools:
appium 1.9.1
xcode 10.1
katalon 6.2.1


[Appium] Capabilities:
[Appium] deviceId: AFB3C889-F300-48E3-B344-4FBA1120DE6A
[Appium] platform: IOS
[Appium] platformName: ios
[Appium] realDeviceLogger: /Applications/Katalon Studio.app/Contents/Eclipse/configuration/resources/tools/deviceconsole
[Appium] webkitDebugProxyPort: 27753
[Appium] app: /IOS-QA-Prod-debug-enabled.app
[Appium] automationName: XCUITest
[Appium] deviceName: iPhone XR
[Appium] fullReset: true
[Appium] newCommandTimeout: 1800
[Appium] noReset: false
[Appium] platformVersion: 12.1
[Appium] startIWDP: true
[Appium] usePrebuiltWDA: false
[Appium] waitForAppScript: true;
[Appium] wdaLocalPort: 58653


Erroe:

2019-07-02 12:23:42.476 ERROR k.k.c.m.CustomKeywordDelegatingMetaClass - ❌ Cannot find any WEBVIEW to switch to

2019-07-02 12:23:42.478 ERROR c.k.katalon.core.main.TestCaseExecutor - ❌ Test Cases/Guest/DTH/Guest Checkout with Visa FAILED.

Reason:

com.kms.katalon.core.exception.StepFailedException: Cannot find any WEBVIEW to switch to

at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:50)

at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.stepFailed(MobileKeywordMain.groovy:40)

at com.kms.katalon.core.mobile.keyword.builtin.SwitchToWebViewKeyword$_switchToWebView_closure1.doCall(SwitchToWebViewKeyword.groovy:74)

at com.kms.katalon.core.mobile.keyword.builtin.SwitchToWebViewKeyword$_switchToWebView_closure1.call(SwitchToWebViewKeyword.groovy)

at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.runKeyword(MobileKeywordMain.groovy:21)

at com.kms.katalon.core.mobile.keyword.builtin.SwitchToWebViewKeyword.switchToWebView(SwitchToWebViewKeyword.groovy:67)

at com.kms.katalon.core.mobile.keyword.builtin.SwitchToWebViewKeyword.execute(SwitchToWebViewKeyword.groovy:62)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)

at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords.switchToWebView(MobileBuiltInKeywords.groovy:819)

at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords$switchToWebView$3.call(Unknown Source)

at crossPlatform.Activity.goToCartPage(Activity.groovy:138)

at crossPlatform.Activity.invokeMethod(Activity.groovy)

at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:50)

at Guest Checkout with Visa.run(Guest Checkout with Visa:25)

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:337)

at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)

at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)

at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)

at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)

at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)

at TempTestCase1562095105111.run(TempTestCase1562095105111.groovy:21)

2019-07-02 12:23:42.634 INFO c.k.katalon.core.main.TestCaseExecutor - END Test Cases/Guest/DTH/Guest Checkout with Visa