Not able to verify whether a youtube video is working properly or not.


#1

Hi,
How to verify whether a youtube video is working properly or not. My scenario is to click on any video which in turn opens in a pop up. Then play the video to verify whether its playing or not and then click on pause button to verify whether it stops or not. And then close the video pop up.
Kindly help.


#2

try to use https://forum.katalon.com/discussion/9799/visual-testing-in-katalon-studio
1. run video
2. pause video
3. take screenshot
4. unpause - wait for x sec
5. pause
6. take 2nd screenshot
7. compare screenshots - if they differ, video is running


#3

I made a quick investigation.

I tried verifying a Youtube video at https://www.youtube.com/watch?v=WndOChZSjTk

I took 1st screen shot and,10 seconds later, 2nd screen shot, and compared them and got the following imageDiff:

The video was properly moving. The video area in the ImageDiff file is painted 100% red — not very informative. You can see many unnecessary elements are compared — they are noisy.

Yes, comparing screen shots would be an option for verifying videos. But I found many shortages in the codes of https://forum.katalon.com/discussion/9799/visual-testing-in-katalon-studio. They needs to be extended much in order to support the Youtube Video case. Especially

7. compare screenshots - if they differ, video is running

This portion is not very easy as it seems.

full_range_push_ups.1st.png

full_range_push_ups.2nd.png

full_range_push_ups.1st.png_full_range_push_ups.2nd.png_diff.png


#4

this evening i’ll try to combine your solution with image search built in Katalon:


in case it’s working as i imagine (no documentation) we can search for 128x128px square of red to confirm video change.

image.png


#5

I am going to try to utilize aShot’s feature: taking a screenshot of specified WebElement (the element), not the whole page.


#6

cool… i’ll try my part when i came from work


#7

I worked on this a bit more.

I used Visual Testing in Katalon Studio approach, with some amount of code changes.

I used the above mentioned Youtube video.

My test scripts generated the following result index page:


In the index, you can see

(1) a Test Suite “LetsKinnikuTogether” was executed at 20181002_063755. It comprised with 2 Test Cases, among which 1 Test Case failed.

(2) a Test Case “main.LetsKinnikuTogether_playing” passed. “passed” means that the video was autoplayed. The video was verified by comparing 2 screenshots of element taken at 0:01 (zero minute 01 seconds) and at 0:11. The images were 98.6% different, which means the video was playing.

(3) a Test Case “main.LetsKinnikuTogether_stopping” failed. “failed” means that the video was not autoplayed, it stayed still. The video was verifyed by comparing 2 screenshots of element taken at 0:02 (leave it stopped for a few seconds) and taken once again. The images were only 0.12% different, which means the video was stopping.

(4) You can see by clicking the PNG file named “Lets_Kinniku_Together_diff(0.12)FAILED.png” as follows: there is very little RED-painted portion, this means the video was staying still.


Now I believe that my Visual Testing in Katalon Studio approach is useful to ensure that the is autoplayed.

I felt a fun working on with Katalon Studio. It’s something new for me.

I needed to change my code set a lot. So I am not going to expose the code set now. I will do it later.


#8

i can see i’m late …
all credits to the man, the myth, the legend - @4280-kazurayam


#9

I have made another post

There I wrote what I have done to verify a YouTube video autoplays or starts still. I found it is a difficult task. My study is far shot for satisfactory level.


#10

Why to make it so difficult? When it is played, paused or error of someking on a youtube video, the name of one of the classes on the HTML is updated automatically.

Example:
When playing:
div class = “html5-video-player ytp-transparent ytp-hide-info-bar ytp-large-width-mode iv-module-loaded ytp-iv-drawer-enabled ytp-ad-overlay-closed playing-mode ytp-autohide”

When paused:
div class = “html5-video-player ytp-transparent ytp-hide-info-bar ytp-large-width-mode iv-module-loaded ytp-iv-drawer-enabled ytp-ad-overlay-closed paused-mode

When the video can not be displayed or available anymore:

div class =“html5-video-player ytp-transparent ytp-hide-info-bar ytp-large-width-mode iv-module-loaded ytp-iv-drawer-enabled ytp-ad-overlay-closed unstarted-mode ytp-hide-controls”

So just create 3 objects in the object repository with these as xpath and automate to click on the video and use the “verify element on page” based on these 3 objects…

Does it make sense?


#11

Yes. That’s far better to solve the stated problem.

I did not pay attention to the class attribute of youtube page at all. To be honest, I just wanted to play on screenshots.