AWS Device Farm: Not able to change context to webview



I am writing test for a hybrid Android app using Appium Nodejs with WebDriverIO.

I am able to test the native screens well. I am not able to change context to webview.

The code to change context looks as follows

    var ctxs1 = await client.getContexts();
    console.log("Available Contexts in fitBitLogin-----");

    ctxs1.every(async function(value, index, array) {
            if(value.includes('WEBVIEW')) {
                 await client.switchContext(value);
                 return false;
            return true;

The following are the logs. You can see that both native and webview contexts are available. But changing the context to webview is failing.

2022-10-01T19:13:50.492Z INFO webdriver: COMMAND getContexts()
2022-10-01T19:13:50.492Z INFO webdriver: [GET]
2022-10-01T19:13:51.723Z INFO webdriver: RESULT [ 'NATIVE_APP', 'WEBVIEW_chrome' ]
Available Contexts in fitBitLogin-----
[ 'NATIVE_APP', 'WEBVIEW_chrome' ]
2022-10-01T19:13:51.723Z INFO webdriver: COMMAND switchContext("WEBVIEW_chrome")
2022-10-01T19:13:51.724Z INFO webdriver: [POST]
2022-10-01T19:13:51.724Z INFO webdriver: DATA { name: 'WEBVIEW_chrome' }
2022-10-01T19:14:16.728Z INFO webdriver: COMMAND findElement("xpath", "//*[@id='ember654']")
2022-10-01T19:14:16.728Z INFO webdriver: [POST]
2022-10-01T19:14:16.728Z INFO webdriver: DATA { using: 'xpath', value: "//*[@id='ember654']" }
2022-10-01T19:15:03.858Z WARN webdriver: Request failed with status 500 due to An unknown server-side error occurred while processing the command. Original error: Process didn't end after 10000ms (cmd: '/opt/chromedriver/linux/65/chromedriver --url-base\=wd/hub --port\=8000 --adb-port\=5037 --verbose')

Please note, on my local machine, with an Android emulator, the test works without any issues.

Any guidance/help will be very useful. Do let me know if you need more inputs.


asked 2 months ago26 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions