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
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Beginnen Sie mit der bereitgestellten Java-Reproduktion unter Verwendung von WebElement.getShadowRoot() im Android WebView und vergleichen Sie sie mit dem älteren JavascriptExecutor-Ansatz. Reproduzieren Sie den getElementShadowRoot-Fehler mit den angegebenen Versionen von Appium, Java client, Selenium und Android. Als abgeschlossen gilt die Aufgabe, wenn das unterstützte Shadow-Root-Verhalten sowie alle Versions- oder Kompatibilitätseinschränkungen festgestellt sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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();
- Vorherrschende Sprache
- Java
- Sterne
- 1.3k
- Forks
- 756
- Ø Merge
- 1 T. 18 Std.
- Gemergte PRs (30 T.)
- 26
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus appium/java-client
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
appium/java-client#2426 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 30/100
appium/java-client#2368 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 30/100
appium/java-client#2341 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 15/100
appium/java-client#2323 ·
Maintainer antworten meist innerhalb von 1 Tag
-
java-client 启动报错Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
appium/java-client#2288 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in appium/java-client
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
navikt/mock-oauth2-server#1129 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug main ui
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
openhab/openhab-webui#4600 ·
Maintainer antworten meist innerhalb von 4 Tagen
-
`DeepSeekChatModel` streaming returns no content when chunks have no `id`Evtl. vergeben @lejuho hat das heute übernommen. Offenstatus: waiting-for-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
spring-projects/spring-ai#7214 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
QuiltMC/update-quilt-meta#28 ·
-
awaiting triage Documentation P3
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 86/100
Maintainer antworten meist innerhalb von 1 Tag