Test Reporting for Web and API Automated Testing

2025-08-01T14:33:38+02:00 | 3 minute read | Updated at 2025-08-01T18:10:26+02:00

Praseeda Achuthawarrier
Test Reporting for Web and API Automated Testing

Test Reporting for Web and API Automated Testing

Test Reporting for Web and API Automated Testing

Test reporting in automation runs is critical because it transforms raw test execution into actionable insights. Without a clear and structured report, teams only see a pass/fail result, which offers little value for debugging or decision-making. A good test report highlights which scenarios passed or failed, provides step-by-step visibility, and includes context like logs, screenshots, or API responses to pinpoint the root cause quickly. It enables faster collaboration between QA and development, helps identify flaky tests or recurring failures, and ultimately improves release confidence by showing the real quality state of the application. Well-structured reporting also supports trend analysis over time, guiding teams on where to invest in test stability and product quality.

Allure Reporting provides structured test reports with:

  • Step-by-step execution flow
  • Nested steps for complex actions
  • Attachments for screenshots, requests, and responses
  • Filtering and grouping of test results
  • Retry visualization to handle flaky tests

I’ve used Allure in:

  • Selenium + Java (Web UI tests)
  • RestAssured + Java (API tests)
  • HTTParty + RSpec (Ruby API tests)

Sample Allure Report

Here’s a sample visual from Allure showing step hierarchy with attachments:

Sample Allure Report

(Replace with your actual screenshot path or hosted image link.)


1. Steps, Nested Steps, and Attachments

  • Steps show major actions
  • Nested steps break them into smaller actions
  • Attachments give context: screenshots for Web, requests/responses for APIs

Java + Selenium Example

import io.qameta.allure.*;

public class LoginTest {
    @Step("Login with username: {username}")
    public void login(String username, String password) {
        enterUsername(username);
        enterPassword(password);
        clickLogin();
        attachScreenshot();
    }

    @Step("Enter username")
    public void enterUsername(String username) { ... }

    @Step("Enter password")
    public void enterPassword(String password) { ... }

    public void attachScreenshot() {
        byte[] screenshot = ((TakesScreenshot)driver).getScreenshotAs(OutputType.BYTES);
        Allure.addAttachment("Screenshot", new ByteArrayInputStream(screenshot));
    }
}

2. RSpec + rspec-allure-commons for API Testing

Allure Report for API Testing

Use Allure steps and attachments for better API reporting.
Steps and attachments can be extracted into a utility module for reuse.

Utility Module

# spec/support/allure_steps.rb
module AllureSteps
  def attach_request(request)
    Allure.add_attachment(name: "Request", source: request.to_s, type: Allure::ContentType::TXT)
  end

  def attach_response(response)
    Allure.add_attachment(name: "Response Body", source: response.body, type: Allure::ContentType::JSON)
  end

  def step(name, &block)
    Allure.step(name, &block)
  end
end

Include in spec_helper.rb:

RSpec.configure do |config|
  config.include AllureSteps
  config.formatter = AllureRspecFormatter
  config.add_setting :allure, default: AllureRspec::RspecAllureCommons.new
end

Example API Spec

RSpec.describe 'User API' do
  it 'fetches user details' do
    step("Prepare request") do
      request = { url: "https://api.example.com/users/1" }
      attach_request(request)
    end

    step("Send request and validate response") do
      response = HTTParty.get("https://api.example.com/users/1")
      attach_response(response)
      expect(response.code).to eq(200)
    end
  end
end

Report Output:

  • Steps: “Prepare request” and “Send request and validate response”
  • Attachments: Request + Response JSON

3. Automatic Retries

  • Combine Allure with JUnit/TestNG retry listeners or RSpec retry gem
  • Retries appear in the report with all failed attempts preserved
  • Helps identify flaky steps while reducing noise

4. Key Takeaways

  • Steps and nested steps make reports self-explanatory
  • Attachments provide immediate debugging context
  • Automatic retries improve stability insights
  • Works seamlessly for Web UI and API testing frameworks

Allure turns test executions into actionable, holistic reports that benefit both QA and development teams.


References

For more details, visit the Allure Reporting Documentation .

© 2025 Praseeda connects

Your smile looks wonderful, See you again!

About Me

Hello, I’m Praseeda, a woman with passions for technology, arts, and community engagement. Originally from Kerala, India, I moved to the Netherlands in 2015 and have been shaping my career in QA and Automation Engineering since 2010.

By profession, I have been always into Quality Assurance and Automation Engineering sector of different Software companies of domains - E-commerce, Healthcare, Banking, Insurance, Entertainment and Legal since 2010. I love the way Quality Engineering is customised in different companies suitable for each of them, which reflects how Engineering is about solving problems. Beyond my core role, I love exploring different areas of the organization—co-organizing Tech Talks and serving as a Work Council member to support and connect with colleagues.

Outside of work, I am deeply passionate about volunteering for socio-cultural activities and expressing my creativity regularly through painting and occationally through dancing. I live in the Netherlands with my husband and our beautiful daughter, cherishing both my roots and the diverse experiences this journey has offered me.

For me, technology, arts, and community are not separate aspects of life but interconnected passions that drive me every day.

Social Links