1
votes

I need to handle the pop up Browser to allow the camera with Robot Framework. Like this https://i.stack.imgur.com/jcWnL.png

I am trying using the keyboard commands, I can go to allow button using the TAB but when I send Keys Press None ENTER isn't pressing Enter in the selected button (Allow button) but using the tab command in Firefox I can't access the allow button. I already tried this solution but doesn't work, don't allow the camera How to access microphone(camera) in robot framework?

Does someone know how to resolve this? I need a solution that works in Chrome and Firefox

1

1 Answers

0
votes

You could use Selenium with C#, Python, Java or JS. This option is also able to be used with Firefox and chrome. First, you'll have to pass in the configuration through to the profile, so once you're on a page which requires camera permissions, it will automatically have them granted. A simple python example below :)

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

opt = Options()
opt.add_argument("--disable-infobars")
opt.add_argument("start-maximized")
opt.add_argument("--disable-extensions")

# 1 = Allow, 2 = Block
opt.add_experimental_option("prefs", { \
    "profile.default_content_setting_values.media_stream_mic": 1, 
    "profile.default_content_setting_values.media_stream_camera": 1,
  })

driver = webdriver.Chrome(chrome_options=opt)
driver.get('http://somesite.com)

Here a tutorial which will help you get up and running in no time https://help.crossbrowsertesting.com/selenium-testing/getting-started/python/