title: We are unable to detect your camera while passing fake media to experitest chrome browser
body: <p>I did not get a specific chrome option to work fine when my test is running on the server where we don't have a webcam when started chrome per the java selenium web driver script.</p>
  <p>The goal is to mock a camera on the server and pass a fake media stream to the server machine where we don't have a webcam. The script is working fine on the local machine (because the local machine has a webcam)  but it's not working on the experitest cloud browser where we don't have a webcam.</p>
  <p>How to mock a camera on devices without a camera so that I can run my script through CI pipeline on a server or cloud browser?</p>
  <p>The below code is working locally but not on the cloud browsers where we don't have support for the webcam and currently facing the <strong>we are unable to detect your camera</strong> error when running on a cloud browser</p>
  <pre><code>    public class Sample {
  
      private static final String ACCESS_KEY = &quot;XXXX&quot;;
      private RemoteWebDriver driver;
      private URL url;
  
  
      private DesiredCapabilities dc = new DesiredCapabilities();
  
      @Before
      public void setUp() throws Exception {
  
               String videoSource = getClass().getClassLoader().getResource(&quot;sample1.y4m&quot;).toURI().toString();
  
      System.out.println(videoSource);
  
      ChromeOptions config = new ChromeOptions();
      config.addArguments( //
              &quot;--use-fake-ui-for-media-stream&quot;, //
              &quot;--use-fake-device-for-media-stream&quot;, //
              &quot;--use-file-for-fake-video-capture=&quot; + videoSource);
          config.setHeadless(true);
  
          config.setAcceptInsecureCerts(true);
  
  
          dc.setCapability(&quot;testName&quot;, &quot;Quick Start Chrome Browser Demo&quot;);
          dc.setCapability(&quot;accessKey&quot;, ACCESS_KEY);
          dc.setCapability(ChromeOptions.CAPABILITY, config);
          dc.setCapability(CapabilityType.BROWSER_NAME, &quot;chrome&quot;);
          driver = new RemoteWebDriver(new URL(&quot;https://XXXXX/wd/hub&quot;), dc);
      }
  
  
      @Test
      public void virtualTryOn() {
  
              driver.get(&quot;https://mytrialpage.com&quot;);
              WebElement cookies = driver.findElement(By.id(&quot;onetrust-accept-btn-handler&quot;));
              cookies.click();       
  
              new WebDriverWait(driver, 10).until(ExpectedConditions.presenceOfElementLocated(By.xpath(&quot;//button[@id='virtualTryOn']&quot;)));
              WebElement vto = driver.findElement(By.xpath(&quot;//button[@id='ctaVirtual']&quot;));
              vto.click();
         
              driver.switchTo().frame(&quot;scan-iframe&quot;);
              
      }
  
      @After
      public void tearDown() {
          System.out.println(&quot;Report URL: &quot;+ driver.getCapabilities().getCapability(&quot;reportUrl&quot;));
          driver.quit();
      }
  
  }
  </code></pre>
  <p>**</p>
  <ul>
  <li>cloud browser output:</li>
  </ul>
  <p>**</p>
  <p><a href="https://i.stack.imgur.com/eNjOs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eNjOs.png" alt="enter image description here" /></a></p>