Test Flow: waits, apps, phones and scripts
Pause the run, open a web app, hand a file to a page, take the network away, start or close an application, connect a phone, or run a Python script at any moment.
Where they live
Ten events belong to the whole test rather than to a track: Wait, Open Web App, Upload File, Run JavaScript, Go Offline, Go Online, Run App, Quit App, Connect Phone and Run Python Script.You find them in the Events palette, under Test Flow.Drop one anywhere on the timeline: it lands on the time ruler, at that moment.
Wait
A Wait pauses the run for a fixed time, then the test carries on.
Open Web App
Opens a web address in the browser you choose and goes on once the page has loaded.The browser opens in a clean window of its own, without your tabs, extensions or sign-ins, so every run starts from the same page.
| Setting | What it means |
|---|---|
| Address | The page the test opens.A name alone, such as shop.example.com, is read as https. |
| Browser | One of the browsers installed on the machine, or its default browser.The test remembers the browser's program, so another machine opens its own copy. |
| Full-screen kiosk mode | The page fills the screen with nothing of the browser around it: no tabs, no address bar, no navigation controls. |
| Give up after | How long the page may take to load before the test goes on. |
Why kiosk mode
What surrounds a page differs from one machine to the next: the browser's version, its theme, a bookmarks bar, the size of its window.In kiosk mode the page is laid out for the screen alone, so the test sees the same picture wherever it runs.
Kiosk mode on a build machine
Kiosk mode asks a few things of the machine that runs the test.
| What happens | What to do |
|---|---|
| The page is laid out for that machine's screen. | Give the build machine the screen size and the display scaling of the recording, or every check looks at another layout. |
| The browser needs a real desktop to draw on. | Run the agent in a signed-in, unlocked desktop session, never as a Windows service or behind a disconnected remote desktop.Otherwise the step fails because the browser showed no window. |
| The browser covers the whole screen, the task bar included. | Let the run's own time limit end a run.A run the pipeline kills leaves the browser in front until someone presses Alt+F4. |
| The window is clean: no saved password, cookie or extension. | Have the test sign in by itself when the page is behind a sign-in. |
| A browser managed by an administrator may refuse kiosk mode or add bars of its own. | Turn kiosk mode off in the step: the page opens in a plain maximized window. |
Upload File
Hands one or more files to the web page, the way choosing them in a file window would, without that window.Put it right after the click that asks the page for a file, such as a Choose image button: the click stays a step of its own, and Upload File answers it.
| Setting | What it means |
|---|---|
| Files | The files to hand over.Add Files... picks one or several; Remove takes the selected one off the list. |
| Check the page received it | The step fails when the page did not take the file, so the report says so at once. |
| Give up after | How long the step may take. |
Run JavaScript
Runs JavaScript inside the web page the test opened: read a value the screen does not show, set the page up for the steps after it, call one of the page's own functions.It runs in whatever browser the test runs in, Chrome, Edge or Firefox, with or without a window, and on every browser and device the test is made for.
| Setting | What it means |
|---|---|
| Script | The JavaScript to run.A single expression gives back its value, such as document.title.Several lines give back what their return says, and await works.Type it right in the Properties panel, or import a .js file: the script travels inside the test. |
| Expected result | What the script must give back for the step to pass: a text, a number, true or false, or JSON.Leave it empty and any result passes. |
| Give up after | How long the script may take before the step fails. |
What the script gives back is written beside the step in the Confidence Report.The step fails when the script stops on an error, takes longer than its time, or gives back something other than the expected result.
After the test adds an item to the basket, a Run JavaScript reads the basket the page keeps for itself: JSON.parse(localStorage.getItem('cart')).length, with Expected result = 1.The step fails the day the page stops saving the basket, even if the screen still looks right.
Go Offline and Go Online
Go Offline cuts the network at this moment of the test, so the steps after it show how your app behaves without a connection: a message, a retry button, work kept until the connection is back.Go Online gives the connection back.
| Take offline | What loses its connection |
|---|---|
| The app under test | For a web test, the page in its browser.For a desktop test, the app the test was recorded on and the apps its Run App steps started. |
| A program | One program you name. |
| This whole computer | Every program, except what runs on the computer itself, so the test keeps running. |
One Go Online gives back everything the Go Offline steps before it took away.The end of the test always does, even when the test stops at a failure, so a computer is never left offline.
Run App
Starts a program at this moment of the test: the app you test, a browser on a given page, a tool that prepares data.
| Setting | What it means |
|---|---|
| Program | The program to start.Pick one of the apps running now, or Browse to any program. |
| Arguments | What to give the program when it starts, such as a web address or a file.Type each one and press Enter. |
| Working folder | The folder the program starts in, when it needs one. |
| Continue | When the test goes on: at once, once the app shows a window, or once the program ends. |
| Window | How the app's window stands once it is up: as it opens, maximized, or full screen. |
| Give up after | How long to wait before the step fails. |
Add a Run App at the very start: Program = your browser, Arguments = the address of your app's sign-in page, Continue = once it shows a window.Every run now starts from the same page, whatever was open before.
Quit App
Closes an app, the way clicking its close button would.If it is still open after the time you give it, it can be closed by force.Put one at the end of a test to leave the screen clean for the next test.
Turn on Only what the test started and it closes just what the test itself opened, never a window of the same app you had open.
Connect Phone
Puts the screen of an Android phone on this screen, so the steps after it work on the phone.A recording on a phone adds it at the start by itself, and the run takes the phone's screen down when it ends.There is nothing to install: plug the phone in by USB with USB debugging on.
The Phone list shows the phones plugged in now, by name.Keep Any phone plugged in to run on whichever phone is there, or pick one so the test always runs on that phone.Detect Phones looks again after you plug one in.
Run Python Script
Runs a short Python script: reset a test database, create a test user, copy a file into place.Type the script right in the Properties panel, or import a .py file.The script travels inside the test, so it runs on any machine that has Python.
A Run Python Script at the start empties the test user's basket through your app's test tools.The test no longer depends on what the previous run left behind.
When a step fails
Every step except a Wait has an If It Fails setting in its Properties: Stop the test, the default, or Continue the test.Continue suits a step whose failure the rest of the test does not depend on, such as a Quit App at the end.Either way, the report says what failed and why.
Still stuck?Tell us what you were trying to do, and we answer within one working day.Ask our team