[Driver bug] iOS element screenshot returns full element size but only viewport-visible content; rest is black
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Tranquilla
- Stack tecnologico
- ios, typescript
- Ambito
- mobile-dev, testing
Direzione di ricerca
Traccia il percorso dello screenshot dell’elemento web da saveWebElement/checkWebElement a browser.takeElementScreenshot(elementId), quindi esamina l’immagine base64 restituita e le dimensioni su iOS. Conferma se l’area nera è già presente nella risposta del driver; il lavoro è completato quando si determina se questo repository può risolvere il problema o se è necessaria una correzione del driver upstream.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
When taking an element screenshot on iOS (Safari, real device or simulator) via the WebDriver takeElementScreenshot command, the driver returns an image that has the dimensions of the element's full bounding rect (e.g. 390×844 px), but only the viewport-visible portion of the element is filled with real pixel data; the rest of the image is black.
This is an upstream driver bug: the automation stack (iOS Safari / WebDriver implementation) returns a full-size bitmap but only captures the visible content. This repository does not create or pad the image; it uses the driver response as-is.
Environment
- Platform: iOS (Safari), real device or simulator
- Flow: Web context,
saveWebElement/checkWebElement(element screenshot of a DOM element) - Reproducible: Whenever the element is taller (or larger) than the viewport
Observed behavior
- User takes an element screenshot of a tall element (e.g. a section that extends below the fold).
- The saved/compared image has width × height equal to the element's full bounding rect (e.g. 390×844).
- Only the top part of the image (the part that was visible in the viewport) shows the actual UI.
- The remaining part of the image is solid black.
So the image is "cropped" to the element's size by the driver, but the driver only fills the viewport-visible region; the rest is black.
Expected behavior
The driver should either:
- Return an image of the full element content (e.g. by capturing the whole element or stitching viewport captures), or
- Return an image that is only as large as the captured content (viewport-visible part only), without a full-size buffer filled with black.
Technical note
In this project, the web element screenshot path calls browser.takeElementScreenshot(elementId) and uses the returned base64 image and its dimensions. No canvas or black padding is applied here; the black area is present in the image returned by the driver.
References
- W3C WebDriver: Element Screenshot
Example
- Lingua principale
- TypeScript
- Stelle
- 156
- Fork
- 62
- Merge medio
- 2h 2m
- PR unite (30g)
- 111
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di webdriverio/visual-testing
-
Proposal: a noise-tolerant compare mode with pixelmatch 8's windowSizeForse già presa @plum117 l’ha presa 3 giorni fa. Apertaenhancement
webdriverio/visual-testing#1311 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
bug: the visual service fails on Android Chrome through Appium 3 in the default WebDriver BiDi session (workaround: `wdio:enforceWebDriverClassic`)Forse già presa @plum117 l’ha presa 3 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
webdriverio/visual-testing#1232 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
feat: support element screenshots of elements in a frame in WebDriver BiDi sessions (v9 `switchFrame()`, v10 `context.frame()`)Forse già presa @plum117 l’ha presa 3 giorni fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 50/100
webdriverio/visual-testing#1228 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Wait for Screenshot to MatchForse già presa @plum117 l’ha presa 2 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
webdriverio/visual-testing#690 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Using checkFullPageScreen method, capturing images with duplicate viewport and is not scrolling to the bottom of the pageForse già presa @plum117 l’ha presa 2 giorni fa. Apertahelp wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
webdriverio/visual-testing#125 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di webdriverio/visual-testing
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 70/100
siyuan-note/siyuan#20517 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
NaturalIntelligence/fast-xml-parser#890 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
zsviczian/obsidian-excalidraw-plugin#3000 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
pnpm/get.pnpm.io#68 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
nuxt-modules/better-auth#578 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno