Example: Open Windows Settings¶
In the previous example we
created an Alyvix test case consisting of a single test case object. Most
of the time though, you’ll need to chain together multiple test case objects to
synthesize more complex behavior in your apps. So let’s extend our previous
example to run a second action: opening the Windows Settings app.
1. Launch
Launch Alyvix Editor with the same file name from our previous example:
C:\Alyvix\testcases> alyvix_editor -f start-test
Editor will load the start-test.alyvix test case created in the previous example.
2. Capture
We want to capture the screen once the Start menu has already opened, so change
the delay number in from 0 to something higher
like 5, then click on .
You’ll then have 5 seconds to open the Windows Start Menu (just click on the Start button yourself within that time limit) before Alyvix captures the screen.
3. Annotate
After the screen flashes white, you will see the screen grab and the crosshairs for annotating any selections. Right click on the Settings icon at the left side of the Start Menu. This will autocontour the icon.
4. Escape
Press Escape again to return to Editor with the new selection in the
Designer panel at the right. Assign a left click action as in the previous
example by changing the value of the Action dropdown from None
to Click:
5. Rename
In the Selector panel at the bottom left, change the name of our new test case object from VisualObject1 to a new one like PressSettingsIcon:
6. Script
Using its 4 arrows icon icon seen above, drag the new test case object
into the Scripting panel underneath the existing script element (similarly,
clicking the
icon will add it to the end of the script):
7. Run
Now call Alyvix Robot by pressing the
button at the top left. You’ll
see the Start Menu open, and then a few seconds later a click on the Settings
icon, at which point the Windows Settings app will open.
8. Result
At the top of Editor, open the panel. This contains the timing results for each script element.
Finally, save and exit Alyvix Editor using the and buttons at the top.