1

I am passing fake media stream for camera and microphone access for one of my webrtc application using selenium python.But i want to allow access for real device microphone and camera.I want to test it for multiple users in a single device.For every users there will be separate incognito window.Is it possible to test the application for multiple users with the camera and microphone access?I have written a script where user will join the video call by taking user id and password from csv.Each user will have separate incognito browser window.This is what i have done so far the access:

chrome_opt = Options()
chrome_opt.add_argument("--incognito")
chrome_opt.add_argument("--enable-infobars")
chrome_opt.add_argument("start-maximized")
chrome_opt.add_argument("--enable-extensions")

chrome_opt.add_argument("use-fake-device-for-media-stream"); # this argument for accepting permissions
chrome_opt.add_argument("use-fake-ui-for-media-stream")

Is it possible to give real time microphone and camera access in a single machine using chrome browser in multiple incognito.How can i do it using selenium ?

jack
  • 351
  • 5
  • 23

1 Answers1

2

use-fake-ui-for-media-stream actually does the accepting permission for getUserMedia calls and use-fake-device-for-media-stream bypasses the real camera and microphone devices. So I think you want:

# comment out this argument to use real camera and microphone
# chrome_opt.add_argument("use-fake-device-for-media-stream"); 

# this argument for accepting permissions
chrome_opt.add_argument("use-fake-ui-for-media-stream")

vipyne
  • 101
  • 5
  • not working for me.i have 2 users in multiple incongnito.camera permission is denied everytime for second user – jack Feb 04 '22 at 04:52
  • can you post the logs? also, have you tried multiple webdriver instances (as opposed to multiple incognito tabs?) I'd wager it will make permissions easier for multiple test "users". – vipyne Feb 08 '22 at 06:57
  • This is a neat feature the green spinning/beeping fake media stream – Jacob David C. Cunningham Apr 17 '22 at 00:23