How to test your website in a real browser with AwanBox
Your page works on your laptop. Does it work for a visitor? Ask an agent to open it in Chrome on its own desktop and try it.
Most students test a page the same way: open it, type something sensible, see the thank-you message, and call it done. A visitor will leave a box empty, mistype an email address, and open the page on a phone.
An awx Large computer has a desktop with Chrome on it, and the agent can use it the way a person does: click, type and look at the screen. This post follows a real run on a small sign-up page.
The first message
We used a Large computer, because the desktop needs one: Small is for a terminal, and Large has the memory a browser wants. In Workbench we pressed New chat, chose On a computer I already have, and sent:
I made a small sign-up page for my club and I want to know
if it really works in a browser. Please build a simple one in
/home/agent/club (name, email, a drop-down for the day I can
come, and a Join button that shows a thank-you message), serve
it on this computer, then open it in the Chrome browser on the
desktop and test it like a visitor: fill it in, press Join,
try an empty form, try a bad email, and look at it at phone
width. Take a screenshot of each test and tell me plainly what
worked and what is broken. Fix anything broken and test again.
You would send the same message about your own page. Replace the first sentence with where your files are, and the tests with the ones that matter for your page.
Watch it work
Open the Desktop tab on the right and press Watch. You see the real desktop, live. Chrome is open on localhost:8000, and you can see the agent's mouse and keyboard at work. Take over lets you use the desktop yourself, for example to type a password. In Watch mode the page cannot be changed from your side.
One thing went wrong at the start, and it is useful to know. Chrome crashed on launch, because its built-in sandbox does not work inside a container. The agent read the error and started Chrome with the sandbox turned off, which is a normal workaround for testing your own page here. Do not use that setting to browse sites you do not trust.
Three tests a visitor would do
1. A correct entry. The agent typed a name, an email address and a day, and pressed Join. The page replied with a thank-you that repeated the name, the day and the email.
2. An empty form. It pressed Join with nothing filled in. Each of the three fields showed its own red message, and no thank-you appeared.
3. A bad email. It typed jamie.example.com, with no @. The page answered "That doesn't look like an email address." and did not accept the form.
The phone test is the hard one
This took most of the run. A desktop Chrome window will not get narrower than about 500 pixels, however you resize it, and a phone is about 390 wide. Chrome's own phone mode in DevTools did not respond to the agent's clicks either. In the end the agent started Chrome again with a separate profile folder and remote debugging switched on, and drove Chrome's phone emulation from a short script. That is a lot of effort for one check, so if the phone view matters to you, say so in the first message and expect it to take longer.
It worked. At 390 pixels the form shrank to fit and nothing ran off the edge. To be sure, the agent also pushed a very long name through, and the thank-you message wrapped onto several lines.
The agent stops after 80 steps in one go, and this run reached that limit while it was still on the phone checks. We wrote a message to continue and asked for a plain report. If you see "stopped after 80 steps", that is all it means.
A bug it found
The report listed four passes and one real problem, found in the extra checks it ran on its own:
An address with two @ signs, ann@@example.com, was accepted. Other odd addresses, such as ann@example and [email protected], were rejected correctly. We asked for the one-line fix and a re-test of only that case.
The change was one line in index.html, a check that the address has exactly one @. The agent reloaded the page without the cache, so the new file was really loaded, and confirmed that a normal address still passes. It then offered to run all the tests again, which is a good habit after any fix, and we skipped it here. The screenshots of each test are saved in /home/agent/club/tests/, in the Files tab.
What it cost
The run was about 25 minutes on a Large computer, which costs RM0.10 an hour while it runs, so under five sen of credit. We stopped the computer afterwards, and it costs nothing while stopped. Small or Large explains the sizes, and how running time and credit work explains the bill.
Cautions
- An agent test is not a full test. It checked the cases we named and a few it thought of. It did not check Safari, Firefox, a screen reader or a slow connection.
- Read the report, then look. The agent can be wrong. Use Watch, or open the saved screenshots, before you trust a "passed".
- The page here is local. It ran at
localhost:8000on the computer. To let your lecturer open it, give it a link, as in the Flask post. - Check your course rules on AI help, and keep your own copy of your files.
awxis in early alpha.
Keep reading
- How to run a script every morning, laptop closed
- How to send your lecturer a link to your Flask assignment
- How to turn a weather API into a web page that stays up
- How to practise SQL with PostgreSQL: SELECT, JOIN, GROUP BY
Getting started
Sign in with your Google account and open Workbench. Start a chat on a Large computer, put your page in a folder, and paste the first message from this post.
Awi, signing off.