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 thường phản hồi trong vòng 5 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu với bản tái hiện Java được cung cấp bằng cách sử dụng WebElement.getShadowRoot() trong Android WebView và so sánh với cách tiếp cận JavascriptExecutor cũ hơn. Tái hiện lỗi getElementShadowRoot với các phiên bản Appium, Java client, Selenium và Android đã nêu. Được coi là hoàn tất khi hành vi shadow root được hỗ trợ và mọi giới hạn về phiên bản hoặc khả năng tương thích đã được xác định.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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();
- Ngôn ngữ chính
- Java
- Star
- 1.3k
- Fork
- 755
- Merge trung bình
- 5 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của appium/java-client
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
appium/java-client#2426 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 50/100
appium/java-client#2372 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
appium/java-client#2368 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 30/100
appium/java-client#2341 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
appium/java-client#2323 ·
Maintainer thường phản hồi trong vòng 5 ngày
Tất cả issue của appium/java-client
Issue tương tự
-
area/frontend good first issue kind/cooldown
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
beehive-lab/TornadoVM#1151 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
(cbor) `maxStringLength` not consistently checked for chunked (indefinite-length) text valuesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
FasterXML/jackson-dataformats-binary#823 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày