FirefoxDriver Html5 video auto-play

65 views
Skip to first unread message

Manoj Joshi

unread,
Sep 11, 2015, 8:40:44 AM9/11/15
to Selenium Users
Hi 

  The video on my html5 website does not auto-play, when I launch through FirefoxDriver.

  However auto-play work, when I launch it using Firefox browser manually or through ChromeDriver.

  I tried to resolve it setting preference "media.autoplay.enabled" = true  in Firefox Profile. seems no luck.

  Please suggest if anyone have solution on this.
  
Thanks
Manoj

Shawn McCarthy

unread,
Sep 11, 2015, 10:47:31 AM9/11/15
to Selenium Users
Can you show your code how you are creating your FirefoxDriver ?

Manoj Joshi

unread,
Sep 14, 2015, 3:00:57 AM9/14/15
to Selenium Users
Hi Shawn,

Below code I am using to initialize the Firefox browser.

public void initDriver() {
FirefoxProfile fp = new FirefoxProfile();
                fp.setPreference("media.autoplay.enabled",true);
driver = new FirefoxDriver(fp);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.manage().window().maximize();

}

Thanks 
Manoj

Shawn McCarthy

unread,
Sep 14, 2015, 10:41:05 AM9/14/15
to Selenium Users
Manoj,

I am not sure. I never had to test for something automatically playing. Maybe open Firefox with selenium (like below), and don't close the browser, open another firefox window manually and go to about:config in both and see if anything is different?
Reply all
Reply to author
Forward
0 new messages