Check 45.08 · UX and conversion

Test buttons and forms

Test every button and form end to end: submission, email delivery, errors, spam protection, keyboard and tracking, then automate the check with Playwright.

Priority
Important
Difficulty
Intermediate
Estimated time
2 hours to 1 day, then ongoing
Free, no account: your progress is saved in this browser.

Ask an AI to check this point on your site

Opens the assistant with a ready-made question: this check, its goal and your site URL.

For Gemini, Copilot or another assistant, copy the question. The link opens the chosen service directly: nothing goes through this site.

In short

A form can display perfectly and send nothing: the email lands in spam, the destination address is out of date, spam protection blocks real visitors, a button breaks after a plugin update. Testing buttons and forms means checking end to end that every action succeeds, all the way to the person who has to handle the request, and that tracking counts each submission exactly once. The deliverable is a completed test grid, rerun at every release, and an automated test that raises an alert when a journey breaks.

Why it matters

Form failures are silent. Nobody complains about a message that never arrived: the visitor thinks you do not reply, and you think the site no longer generates requests. The causes are mundane and common:

  • sending emails from the web server without domain authentication, so they end up in spam or are rejected;
  • a destination address belonging to a former employee or to a deleted mailbox;
  • an update to a theme, plugin or JavaScript library that breaks a button;
  • badly configured spam protection that also rejects humans;
  • the consent banner blocking a script the form depends on;
  • a journey hosted by a third-party provider (appointment booking, payment) that is changed without notice.

All the work on visibility in traditional search and in AI assistants is lost at this last step if it does not work.

What it improves

  • Conversion No request or sale lost to a technical failure.
  • Response time Requests reach the right person, not the spam folder.
  • Measurement One conversion event per real submission, no more, no less.
  • Accessibility Forms usable with the keyboard and with a screen reader.
  • Compatibility with AI agents Correctly named buttons and fields that can be operated without a mouse. A plausible effect, not measured.
  • Rankings No direct effect.

How to check

1. Compare submissions with the requests received. Over a month, reconcile the number of conversion events in your analytics tool, the number of messages received in the destination mailbox or the CRM, and the number of entries recorded by the form if it stores them. Large gaps point to a failure or to skewed tracking.

2. Look for clicks with no effect. In Microsoft Clarity, filter sessions with dead clicks or JavaScript errors occurring after a click, on form pages.

3. Make a real submission with an identifiable address ([email protected]) and check that it arrives, how long it takes and in which folder.

4. Check the authentication of the sending domain:

dig +short TXT example.com | grep -i spf
dig +short TXT _dmarc.example.com

An SPF record that does not include the service that actually sends the site's emails, or a missing DMARC record, often explains lost messages.

How to implement

Step 1 — List buttons and forms

Element Page(s) Expected action Recipient Tracked event Priority
Quote form /devis/ Email to the team + acknowledgment to the customer [email protected] generate_lead 1
“Add to cart” button Product pages Product added, cart counter updated — add_to_cart 1
Payment /commande/ Order created, confirmation email Customer + shop purchase 1
Call link Header Dialer opens — click_tel 2
Newsletter sign-up Footer Contact added, confirmation email Email marketing tool newsletter_signup 3

Sample values. Do not forget secondary forms (complaints, job applications, product returns) and journeys hosted by third-party providers.

Step 2 — Test manually with a grid

On up-to-date Chrome, Firefox, Safari and Edge, on desktop, then on an iPhone and an Android phone (mobile details are in test mobile forms and conversions (opens in a new tab)):

Check Passes if
Valid submission Visible confirmation message, as text, with what happens next (“Reply within 24 working hours”)
Delivery Message received in the right mailbox, not in spam, in less than five minutes
Acknowledgment Received by the visitor, with the right name, with no raw tag such as [your-name]
Empty required field Text error next to the field, input preserved, focus on the first field in error
Invalid email Explicit error, not just a red border
Double click on the button Only one request sent
Keyboard only All fields and the button reachable with Tab, submission with Enter. See test keyboard navigation (opens in a new tab)
Cookies refused The form works after “Reject all”
Spam protection A human gets through without a difficult challenge; a crude automated submission is blocked
Tracking A single conversion event, visible in GA4 DebugView
Links and buttons No dead link or button without effect on the pages of the journey

For tracking, turn on debug mode with Tag Assistant or Tag Manager's Preview mode, then open Admin > Data display > DebugView in Google Analytics 4: the event must appear once per submission. See fix duplicate conversions (opens in a new tab).

Warning: tests in production create real requests and sometimes real orders. Warn the team, use an identifiable test address and cancel the orders, or test on a staging site identical to production.

Step 3 — Make email sending reliable

  • Send through an authenticated service (the SMTP server of your business email or a transactional email service), not through the server's default mail function.
  • A sender address on your domain ([email protected]), with the visitor's address as Reply-To; a sender in the visitor's name ([email protected]) fails authentication checks.
  • SPF, DKIM and DMARC configured for the sending service, following its documentation.
  • A shared destination address ([email protected]) rather than a personal mailbox, checked by at least two people.
  • A copy of the requests stored somewhere other than in email (database, CRM, storage plugin), so nothing is lost if the email system fails.

Step 4 — Automate a regression test

A Playwright test replays the journey in Chromium, Firefox and WebKit at every release. File tests/devis.spec.ts, on a staging site:

import { test, expect } from '@playwright/test';

test('the quote form goes through', async ({ page }) => {
  await page.goto('https://preprod.example.com/devis/');

  await page.getByLabel('Name').fill('Automated test');
  await page.getByLabel('Email').fill('[email protected]');
  await page.getByLabel('Postcode of the property').fill('44000');
  await page.getByRole('radio', { name: 'Servicing' }).check();
  await page.getByRole('button', { name: 'Get my quote' }).click();

  await expect(page.getByText('Thank you')).toBeVisible();
});

test('an error is shown if the email is invalid', async ({ page }) => {
  await page.goto('https://preprod.example.com/devis/');

  await page.getByLabel('Email').fill('adresse-invalide');
  await page.getByRole('button', { name: 'Get my quote' }).click();

  await expect(page.getByText('Check the email address')).toBeVisible();
});

playwright.config.ts configuration for the three browser engines:

import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
  projects: [
    { name: 'chromium', use: { ...devices['Desktop Chrome'] } },
    { name: 'firefox', use: { ...devices['Desktop Firefox'] } },
    { name: 'webkit', use: { ...devices['Desktop Safari'] } },
  ],
});

Run it with npx playwright test. The getByLabel and getByRole locators fail if a label or a button name disappears: along the way, the test also checks part of the accessibility. To integrate it into deployment, see integrate SEO, performance and accessibility tests into CI/CD (opens in a new tab).

Complete this with a regular broken-link crawl using Screaming Frog (free up to 500 URLs). See fix broken links (opens in a new tab).

Step 5 — Monitor continuously

  • A weekly control submission, manual or automated, to a test address: if it does not arrive, an alert goes out.
  • An alert on falling conversions: GA4 lets you create custom insights sent by email, for example when the count of a key event drops sharply from one week to the next. Labels change over time: refer to the Google Analytics Help Center.
  • A full test after every update to the theme, a plugin, the CMS or the payment provider.

WordPress

Versions WordPress 6.4 and later, with the current versions of the plugins mentioned.

  • Contact Form 7: in Contact > Contact Forms, Mail tab, check the recipient, put an address on your domain in From and the visitor's address in Additional Headers (Reply-To: [your-email]). Contact Form 7 does not store messages: the Flamingo plugin, by the same author, keeps them in the admin.
  • Gravity Forms: entries are stored in Forms > Entries; emails are set in the form settings, under Notifications.
  • WPForms: notifications are set in the form settings; entry storage depends on the plan.
  • Email sending: WP Mail SMTP routes WordPress emails through an SMTP provider or a sending API, and offers an email test page in its free version.
  • Spam protection: Contact Form 7, Gravity Forms and WPForms offer integrations with protections such as reCAPTCHA or Cloudflare Turnstile; after enabling one, make a human submission again, including with cookies refused.
  • WooCommerce: place a test order using your payment gateway's test mode, then check the emails in WooCommerce > Settings > Emails.

Shopify

Versions Shopify admin, all plans, November 2026.

Messages from the theme's contact form are sent to the store's sender email address, which you can change in the notification settings (Settings > Notifications). Shopify filters spam based on message content and prefixes suspicious messages with [SPAM] in the subject: create a filter in your mailbox rather than deleting them unread. To test payment without charging, enable Shopify Payments test mode or the test gateway (Bogus Gateway) in Settings > Payments, then turn it off after the test.

Laravel

Versions Laravel 12 and 13; example written with Pest.

Test that the request is validated and stored and that the email goes out, without sending a real message. File tests/Feature/QuoteFormTest.php:

<?php

use App\Mail\QuoteRequested;
use Illuminate\Support\Facades\Mail;

test('a valid quote request is stored and emailed', function () {
    Mail::fake();

    $this->post('/devis', [
        'type' => 'entretien',
        'code_postal' => '44000',
        'nom' => 'Test automatique',
        'email' => '[email protected]',
    ])->assertRedirect('/devis/merci');

    $this->assertDatabaseHas('quotes', ['email' => '[email protected]']);

    Mail::assertSent(QuoteRequested::class, '[email protected]');
});

test('an invalid email is rejected', function () {
    $this->post('/devis', ['email' => 'adresse-invalide'])
        ->assertSessionHasErrors(['email', 'code_postal', 'nom', 'type']);
});

Run it with php artisan test. In production, send emails through a queue and monitor failed jobs (php artisan queue:failed): an email that fails in the queue is a lost request if nobody looks.

Next.js

Versions Next.js 15 and 16 (App Router).

With a Server Action, return an explicit state (success or per-field errors) rather than a simple reload, and disable the button while submitting to avoid duplicates:

'use client';

import { useActionState } from 'react';
import { requestQuote } from './actions';

export function QuoteForm() {
  const [state, formAction, pending] = useActionState(requestQuote, { ok: false, errors: {} });

  if (state.ok) {
    return <p role="status">Thank you, your request has been sent. Reply within 24 working hours.</p>;
  }

  return (
    <form action={formAction}>
      <label htmlFor="email">Email</label>
      <input id="email" name="email" type="email" autoComplete="email" aria-describedby="email-erreur" required />
      {state.errors.email && <p id="email-erreur">{state.errors.email}</p>}

      <button type="submit" disabled={pending}>Get my quote</button>
    </form>
  );
}

The same Playwright test from step 4 applies as is.

Common mistakes

  • Testing the display, not the delivery: the “Thank you” message appears, but the email never arrives.
  • Sending emails “on behalf of” the visitor: they fail SPF and DMARC checks.
  • A single recipient, who is away or has left the company.
  • No copy of the requests outside the email system.
  • Enabling a CAPTCHA without testing again as a human, on mobile and with cookies refused.
  • Testing only after the initial launch, never after updates.
  • Leaving payment test mode on after a test order, or forgetting to cancel test orders.

Frequently asked questions

Why do emails from my contact form go to spam?

Most often, the site sends emails through the server's default function, without domain authentication, or with the visitor's address as the sender. Mail providers then reject these messages or file them as spam. Send through an authenticated SMTP or transactional service, use an address on your domain as the sender, put the visitor's address in Reply-To, and configure SPF, DKIM and DMARC.

How often should a site's forms be tested?

Test every important form after any update to the theme, a plugin, the CMS, the payment provider or the consent tool, and otherwise at least once a month. Ideally, run an automated test, for example with Playwright, at every release, plus a weekly control submission to a test address that triggers an alert if it does not arrive.

How can I test a payment without paying?

Use your payment provider's test mode: Shopify Payments and Shopify's test gateway, or the test mode of WooCommerce gateways, accept test card numbers published by the provider. Place the order end to end, check the confirmation page, the emails and the purchase event, then turn off test mode and delete the test orders.

How do I check that a conversion is not counted twice?

Turn on debug mode with Tag Assistant or Tag Manager's Preview mode, submit the form once, then open DebugView in the Google Analytics 4 admin. The event must appear only once. Then reload the confirmation page: no new event should appear. A duplicate often comes from a tag fired both on submission and on the thank-you page.

Updated on

Topic checklist (PDF)

And now?

In the “UX and conversion” topic

  1. Clarify the value proposition and offers
  2. Make CTAs clearly identifiable
  3. Simplify navigation and forms
  4. Reduce friction
  5. Add reassurance elements
  6. Display contact details and pricing if possible
  7. Add authentic social proof
  8. Test buttons and forms
  9. Test internal search
  10. Test purchase and booking journeys
  11. Analyze drop-offs
  12. Analyze SEO and GEO landing pages
  13. Test CTAs
  14. Optimize landing pages
  15. Measure business results