Showing posts with label QA. Show all posts
Showing posts with label QA. Show all posts

Thursday, 14 May 2026

Intro to QA with Headless Browsers

Headless browsers are used in QA to execute automated browser tests faster and more efficiently by eliminating the graphical user interface (GUI). Because they don't render visuals, they consume fewer resources, enabling rapid, parallel testing in CI/CD pipelines, making them ideal for high-volume functional and regression testing.

Key Reasons for Using Headless Browsers in QA:
  • Faster Execution: Without the need to render CSS, images, or layout, tests run significantly faster.
  • CI/CD Integration: They are ideal for server-side environments where a GUI is unavailable, allowing automated tests to run after every code commit.
  • Lower Resource Usage: They consume significantly less RAM and CPU, allowing for higher parallelization (running many tests simultaneously) without overloading hardware.
  • Automated Functional Testing: They can accurately simulate user actions such as clicking buttons, submitting forms, and navigating pages.
  • Regression Testing: Due to speed and efficiency, they are perfect for running large suites of regression tests to ensure new changes haven't broken existing functionality.
Common tools for headless testing include headless Chrome, Firefox, Puppeteer, and Playwright

Headless browsers parse, compile, and execute the exact same underlying code as standard browsers, but they skip the final step of painting pixels to a physical screen.

What Headless Browsers Still Do
  • Construct the DOM: They parse HTML into a full Document Object Model tree.
  • Apply Styling: They process CSS and calculate layout, element positions, and visibility.
  • Execute JavaScript: They run a full JS engine (like V8 in Chrome) to handle AJAX, animations, and frontend logic.
  • Manage Network Traffic: They make real HTTP requests, download cookies, and handle API responses.

How QA Verifies Visuals Without a Display
  • Layout Queries: Code checks if elements are present, hidden, or overlapping by querying their coordinates.
  • Computed Styles: Scripts verify specific CSS properties, like checking if a button color is exactly rgb(0, 0, 255).
  • Virtual Screenshots: The browser renders the page into an in-memory buffer, allowing QA tools to save PNGs or perform pixel-by-pixel visual regression comparisons.

To help tailor using headless browser to our workflow, we need to know:
  • Which testing framework we are using (e.g., Playwright, Selenium, Cypress)?
  • Are we trying to catch functional bugs or visual layout glitches?
  • Do our tests run on a local machine or a CI/CD server (e.g., GitHub Actions, Jenkins)?

---

Friday, 9 August 2024

Software Development Lifecycle, Environments and DevOps Metrics


Agile Software Development Lifecycle can be visualised as in the following infogram:


image source: LinkedIn (Brij kishore Pandey)



Why do we need multiple environments?


Developers and testers might not like to work on the same environment as they may use and modify the same data and it may impact the developer's troubleshooting ability or the tester's test result reliability. This is why devops may setup multiples of the same infrastructure stack and call them by different names (environments).


QA vs QC vs Testing


Before we list environments, we need to clarify that these terms are not the same:
  • Quality Assurance - ensures that processes and procedures are in place to achieve quality
  • Quality Control - ensures product quality
  • Testing - validates the product against specifications
    • functional
    • non-functional
    • acceptance testing
This is why QA environment might not be the same as Testing environment.



DevOps Environments


Continuous Testing is performed in at least two environment families:
  • Lower environments - any architecture which is not a direct copy of production; environments with different purposes, which don't necessarily need to replicate the Prod system.
    • Dev/Local development
    • Sandbox environments
    • CI environments
    • Test environments
    • QA environments
    • Nonfunctional testing envs 
  • Production replica environments:
    • Pre-Production / Staging -  test deployment into a Prod replica without Prod data; live environments with non-production data and beta testing
    • NPPD (Non-Production environment with Production Data) is a prod replica with prod data.
    • Customer UAT (User Acceptance Testing) /training environment

Production environment - for end users.





image source: LinkedIn (Brij kishore Pandey)