Every time you export a PDF report, Valoraclick QA Tool automatically creates a structured CSV backup of the same session data and writes it to a Google Drive folder — no extra clicks, no separate export step. The backup runs synchronously as part ofDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Beliagal/qa-report-automation/llms.txt
Use this file to discover all available pages before exploring further.
_on_export() in gui.py, immediately after the PDF file is written to disk. The success dialog you see at the end reflects both outcomes in a single message.
How the backup works
The backup is handled byCSVService.export() in services.py. The method follows a precise resolution chain to find the correct Google Drive destination before writing the file.
Windows shortcut resolution
The tool does not hardcode a direct folder path. Instead, it resolves a Windows shortcut (.lnk) to discover the target backup directory at runtime. This allows the underlying Drive folder to be reorganised without changing any application code — only the shortcut target needs to be updated.
The resolution steps are:
- Look for the shortcut at the primary path
G:\Mi unidad\Informes.lnk. - Resolve the target using
win32com.client.Dispatch("WScript.Shell").CreateShortCut(path).Targetpath. This returns the real folder the shortcut points to. - Write the CSV to that target directory if the path was resolved successfully.
- Fall back to
G:\Mi unidaddirectly if the shortcut file does not exist or the resolution raises an exception. - Create the directory with
os.makedirs(..., exist_ok=True)if neither path already exists on disk.
CSV filename format
Every backup file gets a unique timestamped name so that multiple exports on the same day never overwrite each other:CSV file structure
The backup file is written withutf-8-sig encoding (UTF-8 with BOM) so it opens correctly in Microsoft Excel without encoding issues. It contains two logical blocks separated by an empty row:
Campo,Valor, followed by one row per metadata field in the order they are stored in ReportData.metadata. The keys are written exactly as stored: most fields carry a trailing colon (e.g. Aplicación:, Tester:, Fecha:), while the dependencies and executive summary fields are stored without one (dep, resumen).
Block 2 — Test steps: Preceded by the column header Acción,Esperado,Obtenido,Estado,Ruta Imagen, each row corresponds to one test step. The Ruta Imagen column contains the absolute file path of the attached screenshot, or an empty string if no image was attached to that step.
Setup requirements
The following conditions must be met for the CSV backup to reach Google Drive successfully:-
Google Drive for Desktop must be installed and actively syncing on the machine running the QA Tool. By default, Google Drive for Desktop mounts as
G:\Mi unidadon Windows. -
A shortcut named
Informes.lnkmust exist atG:\Mi unidad\Informes.lnk. This shortcut must point to the specific subfolder within your Drive where backups should be stored (for exampleG:\Mi unidad\QA\Backups). -
The
pywin32library must be installed in the Python environment. The shortcut resolution depends onwin32com.client, which is provided by this package.
Behaviour when Drive is not available
If Google Drive is not installed, the drive letter
G: is not mounted, or the shortcut resolution fails for any reason, the CSV backup is silently skipped. The PDF is still generated and saved successfully. The success dialog will display Backup en Drive: No disponible rather than Ok. No error is thrown and no data is lost — you can export the PDF again once Drive is configured to obtain a backup.Related
PDF Export
Learn how the PDF report is structured, how color-coded Pass/Fail rows and inline screenshots are generated, and the full step-by-step export process.
Managing Test Sessions
Understand how Valoraclick QA Tool auto-saves your session to JSON after every step, and how sessions are restored on next launch.