getShadowRoot() method is not working in Appium Webview - The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
Piste de recherche
Commencez par la reproduction Java fournie en utilisant WebElement.getShadowRoot() dans Android WebView et comparez-la à l’ancienne approche JavascriptExecutor. Reproduisez l’erreur getElementShadowRoot avec les versions indiquées d’Appium, Java client, Selenium et Android. Le travail est considéré comme terminé lorsque le comportement pris en charge de shadow root ainsi que toute limitation de version ou de compatibilité sont établis.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
The problem
We are trying to test a hybrid app and we are using webview to test the same . We recently upgraded the appium client from 7.1.0 to 8.0.0 and selenium to 4.1.2 version.
While acccessing the shadow dom element the code is failing on Mobile where as the same code is working fine on Desktop Web automation . In selenium 4 , to access the shadow dom a new method was introduced which is getShadowRoot() . When we try to access the shadow element using getShadowRoot() method then we get below error
org.openqa.selenium.UnsupportedCommandException:
The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
Build info: version: '4.1.2', revision: '9a5a329c5a'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_322'
Driver info: io.appium.java_client.android.AndroidDriver
Command: [1c227afb-151c-4642-a3aa-256dbf33c2c6, getElementShadowRoot {id=0.9766494918888731-11}]
Capabilities {appium:app: D:\release.apk, appium:appActivity: com.iongroup.ionweb.activit..., appium:appPackage: com.iongroup.ionweb.agt, appium:autoGrantPermissions: true, appium:automationName: uiautomator2, appium:chromeOptions: {w3c: false}, appium:chromedriverExecutable: C:\Users\shashank.gupta\nod..., appium:databaseEnabled: false, appium:desired: {app: D:\release.apk, appActivity: com.iongroup.ionweb.activit..., appPackage: com.iongroup.ionweb.agt, autoGrantPermissions: true, automationName: uiautomator2, chromeOptions: {w3c: false}, chromedriverExecutable: C:\Users\shashank.gupta\nod..., deviceName: CVH7N16B14000292, newCommandTimeout: 60, platformName: android, platformVersion: 8.1.0}, appium:deviceApiLevel: 27, appium:deviceManufacturer: Huawei, appium:deviceModel: Nexus 6P, appium:deviceName: CVH7N16B14000292, appium:deviceScreenDensity: 560, appium:deviceScreenSize: 1440x2560, appium:deviceUDID: CVH7N16B14000292, appium:javascriptEnabled: true, appium:locationContextEnabled: false, appium:networkConnectionEnabled: true, appium:newCommandTimeout: 60, appium:pixelRatio: 3.5, appium:platformVersion: 8.1.0, appium:statBarHeight: 84, appium:takesScreenshot: true, appium:viewportRect: {height: 2308, left: 0, top: 84, width: 1440}, appium:warnings: {}, appium:webStorageEnabled: false, platformName: android}
When we use the belowold code which used to work with Android System webview version 95 then we get the below error
(code ) -
WebElement shadowRootForTraderAcc = (WebElement) ((JavascriptExecutor) driver).executeScript("return arguments[0].shadowRoot", shadowDomHostForTraderAcc);
(Error) -
java.lang.ClassCastException: org.openqa.selenium.remote.ShadowRoot cannot be cast to org.openqa.selenium.WebElement
Environment
- Appium version (or git revision) that exhibits the issue: 1.21.0
- Desktop OS/version used to run Appium: Windows 10
- Node.js version (unless using Appium.app|exe):
- Npm or Yarn package manager: 6.14.15
- Mobile platform/version under test: 8.1.0
- Real device or emulator/simulator: Real device ( Nexus 6P)
- Appium CLI or Appium.app|exe: Appium CLI 1.21.0
- Appium Java client : 8.0.0
- Selenium : 4.1.2
Code To Reproduce Issue [ Good To Have ]
WebElement shadowDomHostForTradeSettings = (wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//it-trade-tab//it-account-selector//ion-autocomplete"))));
SearchContext shadowRootForTradeSettings = shadowDomHostForTradeSettings.getShadowRoot();
- Langage dominant
- Java
- Étoiles
- 1.3k
- Forks
- 756
- Merge moyen
- 1 j 18 h
- PR mergées (30 j)
- 26
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Aucun guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de appium/java-client
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
appium/java-client#2426 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 30/100
appium/java-client#2368 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 30/100
appium/java-client#2341 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 15/100
appium/java-client#2323 ·
Les mainteneurs répondent en général sous 1 jour
-
java-client 启动报错Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
appium/java-client#2288 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de appium/java-client
Issues similaires
-
better night vision compatOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
QuicksilverMC/Argentum#31 ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
navikt/mock-oauth2-server#1129 ·
Les mainteneurs répondent en général sous 1 jour
-
[Blockly] historic state medianOuvertebug main ui
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
openhab/openhab-webui#4600 ·
Les mainteneurs répondent en général sous 4 jours
-
26.4 area: tags enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 1 jour
-
`DeepSeekChatModel` streaming returns no content when chunks have no `id`Peut-être pris @lejuho l’a pris aujourd’hui. Ouvertestatus: waiting-for-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
spring-projects/spring-ai#7214 ·
Les mainteneurs répondent en général sous 2 jours