0

How can I check if the video in the main page is autoplay and endless loop? I need the code for that in Open test, can be selenium with java, javascript or python

1 Answers1

0

This post needs more info, but if I'm to assume you are talking about a <video> in your html you can do something like this. (This example is in Python)

# autoplay attribute doesn't have a value attached to it 
# so you'll have to find it with a css selector
try:
    # If it finds the element it is autoplay.
    video = driver.find_element_by_css_selector('video[autoplay]')
except:
     pass  # Video is not autoplay.
Dillon Miller
  • 763
  • 1
  • 6
  • 18