This page explains how to create test cases to verify whether videos on a website or mobile app are correctly played and paused.
Table of contents
Checking playback
To verify that a video is playing, first use the Store image of UI element command to save an image of the video’s initial screen in advance.
Then, play the video for a certain duration and use the Assert UI element's image does not match command.
By confirming that the image saved before playback and the image displayed after playback do not match, you can verify that the video is playing correctly.
The sequence of test steps is as follows:
Checking pause
To verify that a video has stopped, first play the video for a certain duration, then pause it.
Next, use the Store image of UI element command to save the screen of the paused video.
After that, insert a Wait command for a few seconds, followed by the Assert UI element's image matches command.
By confirming that the screen does not change during the waiting period after pausing, you can verify that the video has stopped correctly.
The sequence of test steps is as follows:
Checking with AI
In many video players, elements such as play buttons, seek bars, and timestamps cannot be captured as individual UI elements.
Therefore, it is not possible to check their states using standard verification commands.
However, by using AI Assertion, one of the Generative AI Features, AI can recognize these elements and verify whether the video playback or pause has been performed correctly.
Verifying The Video Playback
For example, you can play a video for about five seconds, pause it, and check the timestamp to confirm that playback occurred properly.
A test result example is shown below:
Verifying The Video Pause
If the video timestamps before and after playback are displayed as follows:
<Before playback>
<After playback>
You can verify that the video has finished playing by using a prompt like the one below:
Note: The behavior of seek bars and timestamps (for example, returning to the start after playback) varies depending on the video player.
Please create prompts appropriate for the behavior of your video player.
Avoiding Ambiguous Prompts
Although prompts such as “Assert that the video is playing” or “Assert that the video has finished playing” may succeed in some cases, they can also cause test failures.
Whenever possible, it is recommended to write prompts that specify concrete conditions—such as the state of the play button or changes in the timestamp—to ensure more reliable verification.