How to fake stream to Chrome instead of using WebCam How to fake stream to Chrome instead of using WebCam selenium selenium

How to fake stream to Chrome instead of using WebCam


I solved that converting a mp4 file to mjpeg, which is a format that also can be used, and setting my chromedriver same as you did, but using a relative path to the file.

options.addArguments("--use-fake-ui-for-media-stream",                     "--use-fake-device-for-media-stream",                     "--use-file-for-fake-video-capture=src/test/resources/sample_640x360.mjpeg"); 

This thread helped me to get there: https://stackoverflow.com/a/52188760/1843429