📊 Self-Healing Reports & Dashboard / İyileştirme Raporları ve Görsel Panel

This guide explains how Automation Sandbox generates JSON and HTML visual report artifacts whenever locator resolution is attempted.

💡 Select Language / Dil Seçin:


🇬🇧 English Guide

💡 Overview

When running automated tests in CI/CD pipelines (e.g. GitHub Actions, Azure DevOps, Jenkins), knowing which locators healed, what changed, and whether AI was used is essential for test maintenance.

SelfHealingEngine emits append-only JSON (healing-report.json) and HTML Dashboard (healing-report.html) report artifacts automatically. Schema v8 records accepted heals and declined or failed attempts, including opt-in batch ownership conflicts, so the report no longer implies a 100% success rate by construction.

For ExecuteWithHealingAsync, an accepted event is written only after the action retry with the proposed element succeeds. If that retry fails, the proposal is not reported as accepted and the locator repository remains unchanged.

HealingReportFileSink writes the next JSON document to an adjacent temporary file and commits it with one atomic replace operation when a report already exists. It never deletes the previous JSON before the replacement. If serialization or the commit fails, the existing history remains readable and the temporary file is cleaned up during normal exception handling. A process or power loss before the atomic commit can leave a harmless temporary file, but not remove the previous report. The HTML dashboard is derived output written after the JSON commit and can be regenerated from that JSON.


⚙️ Enabling Reports via Environment Variables

You can enable automatic report generation without modifying your test code by setting environment variables:

# Set report file output path
export SELF_HEALING_REPORT_PATH="TestResults/healing-report.json"

# Run your test suite as usual
dotnet test TestAutomation/ScenarioRunner/ScenarioRunner.csproj

By default, an interactive HTML Dashboard (healing-report.html) is written alongside the JSON file!


🔍 Report Content & Review Status

Each event in the report contains:

HealingReportDocument.Events contains every attempt. Consumers that need the pre-v7 accepted-only view can use HealingReportDocument.AcceptedEvents; it includes accepted, accepted-unverified, and all legacy entries without requiring hand-written filtering.

Reports can contain captured UI text, automation IDs, model reasoning, and provider error details (including a bounded raw response when parsing fails). Treat both JSON and HTML as sensitive test artifacts; see the LLM Healing Security Model.

[!WARNING] Report size: the candidate list is intentionally unpruned. On very large UI trees a single event can add ~1 MB of JSON (≈1.3 MB measured on a 3,001-node tree), and each Record() call rewrites the whole file — cost grows quadratically with event count. Enable file reports (SELF_HEALING_REPORT_PATH) on CI/diagnostic runs, not on every local run.


🇹🇷 Türkçe Kılavuz

💡 Genel Bakış

CI/CD süreçlerinde (GitHub Actions, Azure DevOps vb.) testleriniz çalışırken hangi elemanların iyileştirildiği, neye dönüştüğü ve yapay zekanın devreye girip girmediği raporlanmalıdır.

SelfHealingEngine motoru çözüm denemelerini anlık olarak JSON (healing-report.json) ve HTML Görsel Gösterge Paneli (healing-report.html) olarak otomatik kaydeder. Şema v8, isteğe bağlı batch sahiplik çakışmaları dahil kabul edilen iyileştirmeleri ve reddedilen veya başarısız denemeleri kaydeder; böylece rapor yapısı gereği %100 başarı izlenimi vermez.

ExecuteWithHealingAsync kullanıldığında kabul edilmiş bir olay, yalnızca önerilen elemanla yapılan eylem tekrarı başarılı olduktan sonra yazılır. Bu tekrar başarısız olursa öneri kabul edilmiş olarak raporlanmaz ve locator repository değişmeden kalır.

HealingReportFileSink, sonraki JSON belgesini hedefle aynı dizindeki geçici dosyaya yazar ve mevcut raporu tek bir atomik değiştirme işlemiyle günceller. Önceki JSON dosyası değiştirmeden önce hiçbir zaman silinmez. Serileştirme veya commit başarısız olursa mevcut geçmiş okunabilir kalır ve normal exception işleyişinde geçici dosya temizlenir. Atomik commit’ten önce süreç ya da güç kesilirse zararsız bir geçici dosya kalabilir, ancak önceki rapor kaybolmaz. HTML paneli JSON commit’inden sonra yazılan türetilmiş çıktıdır ve JSON’dan yeniden üretilebilir.


⚙️ Çevre Değişkenleri İle Raporlamayı Etkinleştirme

Test kodlarınızı değiştirmeden, yalnızca ortam değişkeni tanımlayarak raporlamayı açabilirsiniz:

# Rapor dosyasının yazılacağı konumu belirleyin
export SELF_HEALING_REPORT_PATH="TestResults/healing-report.json"

# Testlerinizi her zamanki gibi çalıştırın
dotnet test TestAutomation/ScenarioRunner/ScenarioRunner.csproj

JSON dosyası oluştuğunda yanında etkileşimli HTML Rapor Paneli (healing-report.html) otomatik üretilir!


🔍 Rapor İçeriği ve İnceleme Durumları

Rapordaki her olay şu bilgileri içerir:

HealingReportDocument.Events tüm denemeleri içerir. v7 öncesindeki yalnızca-kabul-edilen görünümüne ihtiyaç duyan tüketiciler elle filtre yazmadan HealingReportDocument.AcceptedEvents kullanabilir; bu görünüm accepted, accepted-unverified ve tüm eski girdileri kapsar.

Raporlar yakalanmış UI metni, automation ID, model reasoning’i ve sağlayıcı hata ayrıntıları (parse başarısız olduğunda sınırlı bir ham yanıt dahil) içerebilir. JSON ve HTML’yi hassas test artifact’ları olarak kabul edin; LLM Healing Güvenlik Modeline bakın.

[!WARNING] Rapor boyutu: aday listesi bilinçli olarak budanmamıştır. Çok büyük UI ağaçlarında tek bir olay ~1 MB JSON ekleyebilir (3.001 düğümlü ağaçta ≈1,3 MB ölçüldü) ve her Record() çağrısı dosyanın tamamını yeniden yazar — maliyet olay sayısıyla karesel büyür. Dosya raporlarını (SELF_HEALING_REPORT_PATH) her yerel çalıştırmada değil, CI/teşhis çalıştırmalarında açın.