# How do I test a password-protected staging site?

> When you create the test, open "Advanced options" and fill in "Basic authentication": Qanary stores these credentials encrypted and uses them on every run.

Source: https://qanary.dev/en/help/test-a-protected-staging-site  
Updated: 2026-11-04  
Product: Qanary, no-code automated testing for e-commerce  
Site index for AI assistants: https://qanary.dev/en/llms.txt

Qanary can test a staging site protected by the browser's username and password prompt, known as basic authentication and often set up with an `.htaccess` file. You enter the username and password once, when you create the test: Qanary provides them itself when recording and on every run.

## Before you start

- **The staging URL**, reachable from the internet.
- **The username and password** for the sign-in prompt, the ones your tech team gives to the people who do QA.

## Add authentication to a test

1. In Qanary, click "Create a new test."
2. Enter the test name and the staging site's "Starting URL."
3. Open "Advanced options."
4. Under "Basic authentication," fill in "Username" and "Password."
5. Click "Begin recording."

**Expected result**: Qanary's browser opens straight on the requested page, with no sign-in prompt. You record the journey as usual.

## What happens to the password

The basic authentication username and password are always stored encrypted. They are used on every run of the test, without you having to enter them again.

## What Qanary can't reach

Qanary only tests public sites. A starting URL that points to a private network (an internal address, a machine in your office) is rejected with the message "Starting URL points to a private network: Qanary tests public websites only."

A staging site that's only reachable over a VPN, or restricted to certain IP addresses, won't open in Qanary's browser either. Email contact@qanary.dev: we'll look at what's possible with you.

## Production and staging

Each test has its own starting URL. To test the same thing on staging and in production, you need two tests. Many teams keep staging in a separate project: see [How do I organize my projects in Qanary?](https://qanary.dev/en/help/organize-your-projects).

## If it doesn't work

- **The sign-in prompt still shows up**, or the page says "401": check the username and password, then create the test again.
- **The staging page asks for another password**, in a form on the site: that's not basic authentication. Just record the sign-in as part of the journey, as a customer would.

## Frequently asked questions

### Does a login block keep the basic authentication?

Yes. A block is recorded with the same form as a test, advanced options included. See [How do I reuse a login across several tests?](https://qanary.dev/en/help/use-blocks).

### Can I change the password of an existing test?

Not from the test page. If the staging password changes, record the test again with the new password.
