即使在設定螢屏錄制權限后,Testcafe 基本測驗執行在 MachBook Air 11.6.3 (20G405) 上也出現錯誤。
重現步驟
- 創建基本測驗
- 從命令列運行測驗
testcafe chrome -e test_suite/tests/temp_test.ts
- 它提示是否允許錄制螢屏
4. 提供所需的權限

即使在授予權限后也會引發以下錯誤。
Using locally installed version of TestCafe.
TestCafe requires permission to record the screen. Open 'System Preferences > Security & Privacy > Privacy > Screen Recording' and check 'TestCafe Browser Tools' in the application list.
Press any key to retry.
ERROR UnableToAccessScreenRecordingAPIError: The find-window process cannot access the Screen Recording API.
uj5u.com熱心網友回復:
請參閱TestCafe 檔案中的本指南。它描述了如何解決 macOS 上的權限問題。
uj5u.com熱心網友回復:
嘗試從主目錄中洗掉 .testcafe-browser-tools 檔案夾。如果這沒有幫助,請嘗試執行以下命令:
chmod x "/Users/{??user}??/.testcafe-browser-tools/TestCafe Browser Tools.app/Contents/MacOS/testcafe-browser-tools"
另外,如果您使用的是 M1 芯片,請嘗試安裝 Rosetta 2。如果問題仍然存在,我建議您在 TestCafe GitHub 存盤庫中創建一個問題,并添加一個示例專案和一個視頻來演示如何重現它。確保有問題的呼叫堆疊也是可見的。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/424108.html
