Hello,
In my application, when an user clicks on a button of a web view, it opens a page in a custom chrome instance(note this is not a web view but a separate chrome instance is opened).
I am trying to automate this with appium + webdriverIO but facing a challenge. The webview part is working fine but unable to get the custom chrome instance interaction working.
As I found in most of the articles online, they suggested to create a new instance of remote (i.e. WebDriverIO) with proper Android + Chrome related capabilties to be able to interact with this custom chrome instance.
I did so with below piece of code
//code to interact with webview using a separate driver. This part works fine
//new driver to interact with custom chrome instance
const chromeDriver = await remote({
hostname: "localhost",
port: 4723,
capabilities: {
platformName: "Android",
"appium:deviceName": "Pixel_9_API_35",
"appium:automationName": "UiAutomator2",
browserName: "chrome",
"appium:chromedriverExecutable": "Path to correct chromedriver version",
"goog:chromeOptions": {
androidPackage: "com.android.chrome",
androidUseRunningApp: true, // Connect to the already running instance
w3c: false
} as any,
}
});
However, as soon as this chromedriver is initialized, the chrome instance in the emulator on which the desired url was opened closes(crashes)
Below message is what I see in the appium logs
DEBUG @wdio/appium-service: [727f3913][AndroidUiautomator2Driver@435d] [Instrumentation] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:INSTRUMENTATION_RESULT: shortMsg=Process crashed.
Is there a way I can get it to work? Any pointers would really be helpful
Thanks!