Cordova 10 iOS project "Cannot find any WEBVIEW to switch to"

Hi all,

I am using Cordova 10 to create an iOS application using AngularJS. I’m still at the stage of the “Login Authentication” page of the app, but is already facing issues. The app opens with the BundleID. After the app loads, I added a delay to ensure the loading finishes (though I wish to have a “wait for element to appear” rule, but I cannot even detect the Webview, let alone the DOM in it). Then tries to enter a password, and login.

I am able to use the Katalon Recorder to identify the elements (requires switch to WebView on every page changed and a delay added). Using the recorder, I am also able to create the steps below.

But when I try to run this test case, it gets suck on step 3, with the error “Cannot find any WEBVIEW to switch to”.

Any idea how do we actually get the app to detect the DOM in the Cordova WebView?

I tried removing step 3 and 4 and go straight to 5: Set Text, but another error is shown.


I have seen posts from these articles that are unanswered:
Article 1
Article 2
Article 3


This response specifically is worrying.

Would appreciate if someone could let me know what I did wrong here.

Thank you in advance.

Hi,

Have you enable Web Inspector as following: [Mobile] Switch To Web View | Katalon Docs

Hi,

Thanks for the reply.

Yes, I did that as I need to debug the Cordova project while developing too. So definitely it is done. I can see the DOM elements when I use the recorder and click on switch to WebView. but after setting up the test case, when I run it, I see the error above.