java – Selenium managed Chrome and Edge cannot each entry webcams

0
15
java – Selenium managed Chrome and Edge cannot each entry webcams


I’m utilizing Selenium 4 in java to manage Chrome and Edge and different browsers with a view to check a video name app. I’ve a check the place I am beginning up 2 totally different browsers directly with a view to get them to speak with each-other. I’m utilizing OBS to offer digital webcams with customizable feeds in order that I can swap enter for both browser.

Once I begin up 2 Chromium-family browsers I get a difficulty that solely the primary one I launch (at a time) can get and present the total record of cameras whereas the opposite one reveals nothing – even after ready 15+ minutes. If I launch Firefox and Chrome as my browsers then they each can entry the webcam record.

Since Firefox isn’t deliberate to be supported for the primary model of the webapp, that leaves largely chromium household browsers for me to check with (I am on home windows so I can not check safari at this level). Does anybody know why that is occurring and the way I may repair it?

ChromeOptions chromeOptions= new ChromeOptions();
chromeOptions.addArguments("use-fake-ui-for-media-stream");
chromeDriver = new ChromeDriver(chromeOptions);
EdgeOptions edgeOptions= new EdgeOptions();
edgeOptions.addArguments("use-fake-ui-for-media-stream");
edgeDriver = new EdgeDriver(edgeOptions);
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.addPreference("browser.cache.disk.allow", false);
firefoxOptions.addPreference("browser.cache.disk.capability", 0);
firefoxOptions.addPreference("browser.cache.disk.smart_size.enabled", false);
firefoxOptions.addPreference("browser.cache.disk.smart_size.first_run", false);
firefoxOptions.addPreference("browser.sessionstore.resume_from_crash", false);
firefoxOptions.addPreference("browser.startup.web page", 0);
firefoxOptions.addPreference("media.navigator.permission.disabled", true);
firefoxOptions.addPreference("gadget.storage.enabled", false);
firefoxOptions.addPreference("media.gstreamer.enabled", false);
firefoxOptions.addPreference("browser.startup.homepage", "about,clean");
firefoxOptions.addPreference("browser.startup.firstrunSkipsHomepage", false);
firefoxOptions.addPreference("extensions.replace.enabled", false);
firefoxOptions.addPreference("app.replace.enabled", false);
firefoxOptions.addPreference("community.http.use-cache", false);
firefoxOptions.addPreference("browser.shell.checkDefaultBrowser", false);
firefoxDriver = new FirefoxDriver(firefoxOptions);

LEAVE A REPLY

Please enter your comment!
Please enter your name here