'Disable camera in laptop to test no camera on device scenarios in web application

I am writing a test automation framework using java and selenium. I have a scenario where I have to check behaviour of web application when user has a device with no camera.

Is there any way to test this in laptop with camera?

Expected: navigator.mediadevices.enumerateDevices() should return null



Solution 1:[1]

Depending on your laptop, you could deactivate the device (camera). In Windows 10, the quickest way to do this is to go to the device manager and search for your camera. Right-click on it and then deactivate (or even remove, but that would require you to re-install the driver).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Renis1235