I am trying to switch to webview from nativeapp using Javascript. How do I perform this?. Below is what I have tried.
`let contexts = browser.contexts()
console.log(contexts)`
When I perform the above line of code, it correctly gives me the below output
`{ value: [ 'NATIVE_APP', 'WEBVIEW_40618.1' ],
sessionId: '90908a5e-8b80-4de1-aeaf-b881c10ad647',
_status: 0 }`
Now, when I perform this:
` browser.context(contexts[1])
opn("www.google.com").then(() => {
}).catch((err) => {
console.log("Unable to open the URL specified")
console.log(err)
})`
Please note: from the above, opn() is a NPM module used to open a URL
It doesn’t switch to the webview. Can anyone please help me out with this. Everytime I try, it gives the below error
{ Error: Expected a
target[Symbol(originalCallSite)]: [ CallSite {}, CallSite {}, CallSite {}, CallSite {}, CallSite {}, CallSite {}, CallSite {} ], [Symbol(mutatedCallSite)]: [ CallSite {}, CallSite {}, CallSite {}, CallSite {}, CallSite {}, CallSite {}, CallSite {} ] }