Computer-Use Agent
TestDriver's Computer Use Agent builds and runs test by using a computer.
Last updated
Was this helpful?
TestDriver's Computer Use Agent builds and runs test by using a computer.
Last updated
Was this helpful?
Making tests with TestDriver is super easy! Just tell TestDriver what to test on your local machine and TestDriver will look at the screen, generate some commands to control the computer, and execute them.
For this example, we'll be testing an example todo app. The live site is here, and the source for this quick start is here.
TestDriver is not limited to web apps! It has full control of the desktop so you can test desktop apps, browser extensions, or anything else!
Report issues to the testdriverai/testdriverai
repo
You'll need NodeJS version 20 to get started. Windows users will need a couple extra tools.
You will also need NodeJS if you don't have it yet.
Open a new terminal with admin privileges and execute the following command :
This gives TestDriver the right to execute it's scripts and is only valid for the current user.
Install testdriverai
via NPM. This will make testdriverai
available as a global command.
Run testdriverai init in a new folder.
This will walk you through setting up a local project.
Before we get started, let's set up your machine to collaborate with TestDriver.
TestDriver isn't like any framework you've used before. TestDriver makes decisions based on what it can see on your display!
TestDriver only knows about what it can see on your primary display!
For now, set up your environment with a browser window and your terminal side by side like so:
When you enter commands into TestDriver, the current terminal window will minimize and the focus-window
command will bring Chrome or other applications to the foreground.
The application you want to test should be visible before you run the testdriverai
command.
For our example, make a new incognito window in Chrome and load our test webpage:
It's time to test! The following command will launch TestDriver in interactive mode. TestDriver will generate test commands and save them totestdriver/test.yml
.
Now, just tell TestDriver what you want it to do. For our example, try click new task
.
TestDriver will look at your screen and generate a test script. TestDriver can see the screen, control the mouse, keyboard, and more!
TestDriver will execute the command
s found in the yml
codeblocks of the response.
See the yml
TestDriver generated? That's our own schema. You can learn more about it in the Test Steps.
Take your hands off the mouse and keyboard while TestDriver executes! TestDriver is not a fan of backseat drivers.
Feel free to ask TestDriver to perform some more tasks. Every time you prompt TestDriver it will look at your screen and generate more test step to complete your goal.
If something didn't work, you can use /undo
to remove all of the test steps added since the last prompt.
Now it's time to make sure the test plan works before we deploy it. Use testdriver run
to run the test file you just created with /save
.
Make sure to reset the test state!