LambdaTest Community

Find answers, support, and inspiration from other users

Questions
LambdaTest Community
Answered

How can I automate video streaming testing using Selenium?

Please anybody help me in my research on how I can automate video streaming testing using Selenium.

Up Vote Down Vote 0 Votes
Posted 4 months ago

Answers


I worked for a video streaming services company and built a whole automation framework from scratch using JavaScript + Selenium + Appium. So yes it doable. Some ideas to automate the video streaming process is as follows-

  1. Make sure all UI elements in the player have unique ids associated with them. The bottom line is there should be someway to interact with the UI elements uniquely through your automation code. What I used to do is, once I identify different flows to automate for my Video player, I would create stories to add the required ids for the flows. The developers then used to pick up the story and add the missing ids for those UI elements in that flow.
  2. I was automating both Android and iOS video players. The Appium UI inspector is your best friend for knowing what ids are missing from the UI elements for both the players. It gives exact information on what ids are already present and what needs to be added. I always had the UI inspector open.
  3. You are going to run into this issue and I am saving you time and grief in advance. You will be tasked to automate the process of ensuring whether a stream is playing or not i.e how do you know a particular movie is playing on the player? For this, I used some simple logics.
  • I will get the starting duration of the player which is 0:00 and then after 15 seconds will get the playing time duration again which would be about 0:15. Then I will do a comparison to ensure the time duration is not 0:00 still. This will to a certain extent tell me whether the movie is progressing or not
  • I also had a logic where I will move the scrubber bar to the middle of the scrubber line and ensure the move still plays. For this, I get the total time duration of the movie which I can get via an id (since it is present on the screen), then I divide that in half, then I move the scrubber using its id to this time duration programmatically
  1. We also had some config files that controls some of the aspects of the video player such as the amount of time after which the player controls will disappear from the screen after inactivity, the ability to see certain icons like Captions, Subtitles, Language etc on the screen and so on. I had a separate config file where I manipulated some of these default configs . For example - I set the time out for the player default controls to disappear to 2 mins instead of the default 5 seconds. This gave me enough time to validate various player elements in the UI when the player is first opened up.

  2. When you run the tests in a CI/CD pipeline make sure the Jenkins machine you are using for example is connected directly to internet via an ethernet cable for more stable internet connection. Also ensure the test devices that are connected to your Jenkins machine are connected to stable Wi-Fi connection which is not spotty. This will avoid test failures due to poor internet connection.

Hopefully some of the above information helps you in your video streaming automation. Best of Luck!!!

Up Vote Down Vote 0 Votes
Posted 2 months ago
281 Views
1 Answer
4 months ago