Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Driver bug] iOS element screenshot returns full element size but only viewport-visible content; rest is black

Chiusa
#1,127 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

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

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

bug third party bug

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

  1. User takes an element screenshot of a tall element (e.g. a section that extends below the fold).
  2. The saved/compared image has width × height equal to the element's full bounding rect (e.g. 390×844).
  3. Only the top part of the image (the part that was visible in the viewport) shows the actual UI.
  4. 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

Example

Image
Lingua principale
TypeScript
Stelle
156
Fork
62
Merge medio
2h 2m
PR unite (30g)
111

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di webdriverio/visual-testing

Tutte le issue di webdriverio/visual-testing

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.