I’m utilizing Selenium 4 in java to manage Chrome and Edge and different browsers with the intention to take a look at a video name app. I’ve a take a look at the place I am beginning up 2 totally different browsers directly with the intention to get them to speak with each-other. I’m utilizing OBS to supply 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 problem that solely the primary one I launch (at a time) can get and present the total listing 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 listing.
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 take a look at safari at this level). Does anybody know why that is taking place 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);