RajPal
RajPal

Reputation: 21

How to automate the clicking of the "Allow" button on this pop up?

I am using Ruby and Selenium to start a video visit. After I navigate to the video visit URL I am displayed a pop up requesting permission to use the camera and microphone:

a pop up requesting permission

I am stuck at this point. This window is not part of the DOM. So, I am not able to identify the elements. I tried recording. That also did not record those clicks.

I do not want to use the Chrome options and use fake media. I saw a tab solution, but that is not working for me. I also tried to switch to an alert but I was displayed a NoAlertPresentError.

Any suggestions or ideas that can be implemented using Ruby?

Upvotes: 2

Views: 755

Answers (1)

sokkyoku
sokkyoku

Reputation: 2221

Chrome has a switch to skip these: --use-fake-ui-for-media-stream

Add that to your switches when you create your webdriver instance and the permission request won't appear, removing the need to accept it.

In ruby it looks like this:

Selenium::WebDriver.for(:chrome, switches: %w(--use-fake-ui-for-media-stream))

Upvotes: 1

Related Questions