title: Safaridriver not support select audio/ video device
body: <p><strong>Problem</strong>
  In Mac OS, when use Safaridriver open a Safari browser for <a href="https://webrtc.github.io/samples/src/content/devices/input-output/" rel="nofollow noreferrer">WebRTC samples</a>, the audio input source only display Mock device (audio: Mock audio device 1/ Mock audio device 2 , video: Mock video device 1/ Mock video device 2)  but not display Mac OS physical or Virtual audio/video device .
  Safaridriver control Safari browser actually result :
  <a href="https://i.stack.imgur.com/uGYHd.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>Except result :
  <a href="https://i.stack.imgur.com/YytwO.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p><strong>Research</strong></p>
  <ol>
  <li><p>Manually open Safari browser , user can set Use Mock Capture Devices (Safari browser-&gt;Develop-&gt;WebRTC→Use Mock Capture Devices).
  <a href="https://i.stack.imgur.com/JcmLy.png" rel="nofollow noreferrer">enter image description here</a></p>
  </li>
  <li><p>If enable Use Mock Capture Devices ,   thin-client meeting or WebRTC samples can reproduce above problem .Debug WebRTC samples source code  , navigator.mediaDevices.getUserMedia get device return Mock device .
  <a href="https://i.stack.imgur.com/twEbl.png" rel="nofollow noreferrer">enter image description here</a></p>
  </li>
  <li><p>From safaridriver readMe, no configure can set Use Mock Capture Devices , because WebDrier test not support live media capture
  &quot;For security reasons, Safari does not permit live media capture during a WebDriver test session.  Instead, mock capture devices and streams with well-known contents are provided for testing purposes. &quot;
  (In Mac OS , cd/Library/Apple/System/Library/CoreServices/SafariSupport.bundle/Contents/MacOS , man safaridriver)</p>
  </li>
  <li><p>From safaridriver debug log,  safaridriver not provide any configure for
  SafaridirverLog</p>
  </li>
  </ol>
  <pre><code>
  2022/04/02 10:45:35:854  HTTPServer: --&gt; HTTP 200
  2022/04/02 10:45:35:855  HTTPServer: --&gt; {&quot;value&quot;:{&quot;sessionId&quot;:&quot;DC112ED7-A4DC-42B6-B545-673CBF3C0737&quot;,&quot;capabilities&quot;:{&quot;safari:platformVersion&quot;:&quot;12.2.1&quot;,&quot;safari:automaticInspection&quot;:false,&quot;webkit:WebRTC&quot;:{&quot;DisableICECandidateFiltering&quot;:false,&quot;DisableInsecureMediaCapture&quot;:false},&quot;browserVersion&quot;:&quot;15.3&quot;,&quot;strictFileInteractability&quot;:false,&quot;browserName&quot;:&quot;Safari&quot;,&quot;safari:useSimulator&quot;:false,&quot;safari:automaticProfiling&quot;:false,&quot;setWindowRect&quot;:true,&quot;acceptInsecureCerts&quot;:false,&quot;safari:platformBuildVersion&quot;:&quot;21D62&quot;,&quot;safari:diagnose&quot;:true,&quot;platformName&quot;:&quot;macOS&quot;}}}
  </code></pre>
  <ol start="5">
  <li>From selenium-safari-driver-4.1.3 (The latest release), no configure for Use Mock Capture Devices</li>
  </ol>
  <p><strong>Reproduce demo</strong>
  SafariDriverDebug.java</p>
  <pre><code>import org.openqa.selenium.safari.SafariDriver;
  import org.openqa.selenium.safari.SafariOptions;
   
  import org.openqa.selenium.WebDriver;
  public class SafariDriverDebug {
  public static void main(String[] args) throws  Exception{
      SafariOptions options = new SafariOptions();
      options.setCapability(&quot;safari:diagnose&quot;, &quot;true&quot;);
      //options.setCapability(&quot;safari:automaticProfiling&quot;, &quot;true&quot;);
      WebDriver driver = new SafariDriver(options);
      // Launch Website
      driver.navigate().to(&quot;https://webrtc.github.io/samples/src/content/devices/input-output/&quot;);
      Thread.sleep(3000);
      // Close the Browser
      driver.close();
      }
  }
  </code></pre>