microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
66.96k stars 3.67k forks source link

[BUG][Chromium] AudioRtpReceiver::OnSetVolume: No audio channel exists - error with testing microphone in the Twillio video calls #5794

Closed arkjel closed 3 years ago

arkjel commented 3 years ago

Context:

Describe the bug

When I try to launch my test, I get the following error message. It occurs when I try to test my microphone in the waiting room to the meeting in my application (it is similar to the waiting room in the Google Meet when you can choose your microphone and camera). The app uses Twilio for video calls. The core issue you can see in that line:

Chromium:

Firefox:

Important notice:

Conclusion & Thoughts

Do you plan to implement these flags to the Playwright? They might fix my issue. What do you think?

Source: https://webrtc.github.io/webrtc-org/testing/

Error logs from Chromium:

➜ yarn test:e2e:local:start yarn run v1.22.5 $ dotenv -e .env.test -- yarn test:e2e:debug $ PWDEBUG=1 jest --config ./jest.config.json --detectOpenHandles FAIL e2e-tests/toDo/loginWithURL.spec.ts (65.696 s) Login to the Front ✕ Login as a Participant (62962 ms) ● Login to the Front › Login as a Participant page.click: Protocol error (Runtime.callFunctionOn): Browser closed. ==================== Browser output: ====================

/Users/ajelonek/Library/Caches/ms-playwright/chromium-854489/chrome-mac/Chromium.app/Contents/MacOS/Chromium --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=TranslateUI,BlinkGenPropertyTrees,ImprovedCookieControls,SameSiteByDefaultCookies,LazyFrameLoading --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --user-data-dir=/var/folders/px/s5r2dsjs1t3c8yvzmr32d93r0000gn/T/playwright_chromiumdev_profile-ebz2UV --remote-debugging-pipe --no-sandbox --no-startup-window pid=29563 [err] [29603:83715:0311/101727.631315:ERROR:audio_rtp_receiver.cc(88)] AudioRtpReceiver::OnSetVolume: No audio channel exists. [err] [29603:83715:0311/101728.440561:ERROR:audio_rtp_receiver.cc(88)] AudioRtpReceiver::OnSetVolume: No audio channel exists. [err] [29640:84227:0311/101740.087723:ERROR:audio_rtp_receiver.cc(88)] AudioRtpReceiver::OnSetVolume: No audio channel exists. [err] [29640:84227:0311/101740.616038:ERROR:audio_rtp_receiver.cc(88)] AudioRtpReceiver::OnSetVolume: No audio channel exists. [err] [29647:775:0311/101747.329148:ERROR:system_services.cc(31)] SetApplicationIsDaemon: Error Domain=NSOSStatusErrorDomain Code=-50 "paramErr: error in user parameter list" (-50) [err] [0311/101758.979066:WARNING:crash_report_exception_handler.cc(240)] UniversalExceptionRaise: (os/kern) failure (5) =========================== logs =========================== waiting for selector "text=My microphone is working" ============================================================ Note: use DEBUG=pw:api environment variable to capture Playwright logs.page.click: Protocol error (Runtime.callFunctionOn): Browser closed. **Code Snippet** browser = await chromium.launch({ headless: false }); const context = await browser.newContext(); context.grantPermissions(['microphone', 'camera']); participantPage = await context.newPage(); await page.goto(process.env.TEST_BRIEFING_URL); await page.fill('input[type="email"]', 'random@example.com'); await page.click('button[type="submit"]'); await page.fill('input[type="password"]', 'password'); await Promise.all([page.click('text=Login')]); await participantPage.click('button:has-text("OK")'); await participantPage.click('text=My microphone is working');
arkjel commented 3 years ago

I resolved the issue! You can push the flag --use-fake-ui-for-media-stream directly to the chromium or firefox via args key:

const browser = await chromium.launch({ args: ['--use-fake-ui-for-media-stream'] });

You can put this information to the docs for future users :)

avodovnik commented 3 years ago

Thanks @arkjel - good to hear you've found the solution. We'll see about potentially adding more info in the docs.