I’m currently working on automating a hybrid app using Appium WebDriverIO. My script successfully switches to the webview context without any issues. However, I’m facing a problem when trying to locate an element inside the webview using XPath: //input[@data-testing-id='name-input']
.
I’ve verified that the XPath is correct by inspecting the webview using chrome://inspect/#devices
, where the element is present.
[0-0] 2023-09-07T09:04:40.093Z INFO webdriver: RESULT {
[0-0] error: 'no such element',
[0-0] message: `no such element: Unable to locate element: {"method":"xpath","selector":"//input[@data-testing-id='name-input']"}\n` +
[0-0] ' (Session info: webview=116.0.0.0)',
[0-0] stacktrace: '\tGetHandleVerifier [0x00007FF6C7CB52A2+57122]\n' +
[0-0] '\t(No symbol) [0x00007FF6C7C2EA92]\n' +
[0-0] '\t(No symbol) [0x00007FF6C7AFE3AB]\n' +
[0-0] '\t(No symbol) [0x00007FF6C7B37D3E]\n' +
[0-0] '\t(No symbol) [0x00007FF6C7B37E2C]\n' +
[0-0] '\t(No symbol) [0x00007FF6C7B70B67]\n' +
[0-0] '\t(No symbol) [0x00007FF6C7B5701F]\n' +
[0-0] '\t(No symbol) [0x00007FF6C7B6EB82]\n' +
[0-0] '\t(No symbol) [0x00007FF6C7B56DB3]\n' +
[0-0] '\t(No symbol) [0x00007FF6C7B2D2B1]\n' +
[0-0] '\t(No symbol) [0x00007FF6C7B2E494]\n' +
[0-0] '\tGetHandleVerifier [0x00007FF6C7F5EF82+2849794]\n' +
[0-0] '\tGetHandleVerifier [0x00007FF6C7FB1D24+3189156]\n' +
[0-0] '\tGetHandleVerifier [0x00007FF6C7FAACAF+3160367]\n' +
[0-0] '\tGetHandleVerifier [0x00007FF6C7D46D06+653702]\n' +
[0-0] '\t(No symbol) [0x00007FF6C7C3A208]\n' +
[0-0] '\t(No symbol) [0x00007FF6C7C362C4]\n' +
[0-0] '\t(No symbol) [0x00007FF6C7C363F6]\n' +
[0-0] '\t(No symbol) [0x00007FF6C7C267A3]\n' +
[0-0] '\tBaseThreadInitThunk [0x00007FF9F65226BD+29]\n' +
[0-0] '\tRtlUserThreadStart [0x00007FF9F6B6DFB8+40]\n'
[0-0] }
Appium Version : 1.20.2
Chrome(Webview) Version : 116.0.5845.164
Chromedriver Version : 116.0.5845.96
Verified Context Switching: I’ve made sure to correctly switch to the webview context.
Specified ChromeDriver Path: Appium was unable to get ChromeDriver version 116 automatically. To address this, I specified the ChromeDriver executable path inside the capabilities using the chromedriverExecutable capability
Tried Upgrading appium-chromedriver: In an attempt to resolve the issue, I upgraded the appium-chromedriver package to its latest version. However, the problem persisted.
Any further guidance or insights would be greatly appreciated. Thank you!