ChromeDriver FlashPolicyHelper does not work remotely



  • We're using the

      new FlashPolicyHelper(driver).addSite("https://your.site")
    

    In order to bypass the getFlash prompt when trying to navigate to our websites that use Flash.

    However this does not seem to work when executed remotely.

    Current Implementation

    Calling the FlashPolicyHelper Class

    if(browser.driver instanceof ChromeDriver)
        {
          new FlashPolicyHelper((ChromeDriver) browser.driver).addSite(odysseyURL)
        }
        browser
    
    
    public class FlashPolicyHelper
    {
    private final ChromeDriver driver;
    
    public FlashPolicyHelper(ChromeDriver driver) {
        this.driver = driver;
    }
    
    public FlashPolicyHelper addSite(String site) {
        try {
            this.driver.get("chrome://settings/content/siteDetails?site=" + site);
    ... rest of code for FlashPolicyHelper found here...
    

    https://stackoverflow.com/questions/52185371/allow-flash-content-in-chrome-69-running-via-chromedriver



  • I realized I needed to instantiate a Remote Web Driver in order to obtain functionality remotely. Solved.

    if(browser.driver instanceof RemoteWebDriver)
    {
      new FlashPolicyHelper((RemoteWebDriver) browser.driver).addSite(odysseyURL)
    }
    browser
    
    
    public class FlashPolicyHelper
    {
    private final RemoteWebDriver driver;
    
    public FlashPolicyHelper(RemoteWebDriver driver) {
    this.driver = driver;
    }
    
    public FlashPolicyHelper addSite(String site) {
    try {
        this.driver.get("chrome://settings/content/siteDetails?site=" + site);
    ... rest of code for FlashPolicyHelper found here...
    

    https://stackoverflow.com/questions/52185371/allow-flash-content-in-chrome-69-running-via-chromedriver



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2