In our application we have a functionality to allow camera to capture videos or pictures, we have written code to handle it but not finding any proper solution
**Approach1 : at google browser option level **
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--disable-popup-blocking");
chromeOptions.addArguments("--start-maximized");
chromeOptions.setCapability("appium:chromeOptions", ImmutableMap.of("w3c", false));
chromeOptions.addArguments("--use-fake-device-for-media-stream");
chromeOptions.addArguments("--use-fake-ui-for-media-stream");
**Approach2: using robot**
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_TAB);
robot.keyPress(KeyEvent.VK_ENTER);
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(50));
robot.keyPress(KeyEvent.VK_TAB);
robot.keyPress(KeyEvent.VK_ENTER);
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(50));
robot.keyPress(KeyEvent.VK_TAB);
robot.keyPress(KeyEvent.VK_ENTER);
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(50));
robot.keyRelease(KeyEvent.VK_CONTROL);
robot.keyRelease(KeyEvent.VK_TAB);
robot.keyRelease(KeyEvent.VK_ENTER);
when run the code still the pop up existing and asking to allow or accept it
scope: desktop and mobile web browser (chrome),
platform: macOS, android emulator, real devices , chrome browser
TechStack: Selenium 4.20 ,Appium Java-client 9.2.2,
I am seeking some ones assistance to fix the issues.
please refer the attachment for pop up
I need a fix to handle media related pop up through selenium+appium