How to generate XCTestHTML Report from XCUITest

Pradap Pandiyan
5 min readMar 17, 2024

Introduction: XCUITest, Apple’s UI testing framework allows developers to automate user interface tests, verifying app functionality across different scenarios. While Xcode provides built-in test result summaries, visualizing these results in a comprehensive HTML report can greatly enhance the testing process. In this article, we’ll delve into integrating XCTestHTMLReport with XCUITest, offering a detailed guide with code snippets for seamless implementation.

Prerequisites: Before we begin, ensure you have the following prerequisites:

  • Xcode installed on your macOS machine.
  • Basic understanding of Swift programming language.
  • Familiarity with XCUITest framework.

In this article, we are going to compare XCUITest Report and XCUI HTML Report

report comparison

I have created a sample application with different login scenarios to validate the different types of tests. Here is the code for the login screen with different validations

import SwiftUI

struct LoginView: View {
@State private var username = ""
@State private var password = ""
@State private var…



Pradap Pandiyan

I’m a passionate QA Engineer. I’m a motovlogger, content creator, off-roader and freelancer. Buy me a coffee here