In the title you write you are on AWS, so the question is: which audio device to you try to use there?
On a Debian Stretch notebook /dev/snd looks like this:
I also have seq and timer, that’s it.
In any case, i solved it by using pulseaudio’s server and creating fake audios like so:
USER root
# Install pulse audio and python
RUN apt-get -qq update && apt-get -qq install -y pulseaudio pavucontrol python python3-pip
RUN pip3 install selenium
# Copy the media folder of this repo to opt/media in the container
#RUN mkdir -p /opt/media
#COPY media /opt/media/
# Use custom entrypoint
COPY entrypoint.sh /opt/bin/entrypoint.sh
USER seluser
ENTRYPOINT ["sh", "/opt/bin/entrypoint.sh"]
and entrypoint:
#!/usr/bin/env bash
# Load pulse audio
pulseaudio -D --exit-idle-time=-1
# Create a virtual speaker output
pactl load-module module-null-sink sink_name=SpeakerOutput sink_properties=device.description="Dummy_Output"
# Create a virtual microphone
pacmd load-module module-virtual-source source_name=VirtualMicrophone
# Stand up a local server that serves the media files within opt/media
python -m SimpleHTTPServer &>/dev/null
# Start Selenium Test
cd /apps
python3 selenium-start.py
and selenium_start.py is the actual selenium test, which should include something like: