0
votes

I am working on robot framework where in i am not able to allow chrome camera allow popup from the browser. Please help on this or code will help a lot.

enter image description here

2
Hello! I don't know robotframework, but it seems to me that the description of your issue is really short and nobody will be able to help you with no further information: browser version, computer OS and version, etc. - Joël
Welcome to Stack Overflow where we aim to assist you with your programming difficulties. A good question contains certain information as described in the How to Ask section of the help center. Chief among them is the minimal reproducible example. If you have tried several approaches, it helps to highlight them and the observed results. This prevents unnecessary questions for clarifications and probably increases the number of answers and their suitability for your specific situation. - A. Kootstra

2 Answers

4
votes

Need to create webdriver with preferences which allows microphone (--use-fake-ui-for-media-stream)

Similar question solution is explained here how to handle web based alert or pop ups in robot framework?

Java or python related solution explained here How do i allow Chrome to use my microphone programatically?

Snippet:

Chrome With Preferences
    ${chrome_options} =     Evaluate    sys.modules['selenium.webdriver'].ChromeOptions()    sys, selenium.webdriver

    &{SiteOptions}         Create Dictionary    last_used=${1470931206}     setting=${1}
    &{media_stream_mic}    Create Dictionary    https://www.google.nl:443,*=${SiteOptions}
    ${prefs}               Create Dictionary    profile.content_settings.exceptions.media_stream_mic=${media_stream_mic}

    Call Method    ${chrome_options}    add_experimental_option    prefs    ${prefs}

    Create WebDriver    Chrome    chrome_options=${chrome_options}
0
votes

Below is the sample code -

${chrome_options}=  Evaluate    sys.modules['selenium.webdriver'].ChromeOptions()   sys
Call Method ${chrome_options}   add_argument    --use-fake-ui-for-media-stream
Call Method ${chrome_options}   add_argument    --use-fake-device-for-media-stream
Create Webdriver    Chrome  alias=tab1  chrome_options=${chrome_options}