Test Cafe Requires Permission To Record Screen -> but permission is already granted on MAC
See original GitHub issueWhat is your Test Scenario?
To be able to record the screen on failures
What is the Current behavior?
Copying from #4684 (which is closed & locked)
I recently upgraded my mac to Big Sur, and installed the latest alpha version of TestCafe (1.15.0-aplpha.1). When trying to run testcafe I get
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.
at runFindWindowBinary
Screen Recording Permission has already been granted for TestCafe… following the advice in #4684, I have unchecked and rechecked TestCafe Browser Tools + restarted my Mac
Your complete configuration file (if any):
{
"browsers": ["chrome:headless:emulation:device=iPhone X"],
"src": "./tests/**/*.js",
"clientScripts":[
{
"module":"axe-core/axe.min.js"
}
],
"assertionTimeout": 15000,
"pageLoadTimeout": 30000,
"selectorTimeout": 15000,
"disableMultipleWindows": false,
"quarantineMode": false,
"skipJsErrors": true,
"disablePageCaching": true,
"reporter": [
{
"name": "xunit",
"output": "artifacts/test-results/results.xml"
},
{
"name": "spec"
}
],
"screenshots": {
"fullPage": true,
"takeOnFails": true,
"pathPattern": "${TEST_ID}/${RUN_ID}_${FILE_INDEX}.png",
"path": "artifacts/screenshots"
}
}
Your complete test report:
The "quarantineMode" option from the configuration file will be ignored.
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.
at runFindWindowBinary (/Users/rcooper/work/github.com/change/regression-qaa/node_modules/testcafe-browser-tools/src/api/find-window.js:36:19)
Type "testcafe -h" for help.
Screenshots:
<img width="905" alt="Screenshot 2021-05-01 at 3 57 52 PM" src="https://user-images.githubusercontent.com/37812673/116797143-4804f480-aa97-11eb-9f77-2a131a995d76.png">
Steps to Reproduce:
Using Big Sur MacOS, run: testcafe chrome -q passCount=1
Your Environment details:
- testcafe version: 1.15.0-alpha.1
- node.js version: 12.14.1
- command-line arguments: testcafe chrome -q passCount=1
- browser name and version: chrome 90.0
- platform and version: MacOS Big Sur 11.3
- other:
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
testing - TestCafe Requires Permission To Record Screen but ...
I use testCafe v1.18.1 in both projects. My environment : MAC OS Montery v12.1. I've tried: (-)delete button to delete testcafe ...
Read more >Grant or Fix TestCafe Permissions on macOS | Recipes | Docs
Open the “Security and Privacy” pane of the “System Preferences” dialog. · Click the lock at the bottom left of the dialog. ·...
Read more >Control access to screen recording on Mac - Apple Support (IE)
Control access to screen recording on Mac · Choose Apple menu > System Settings, then click Privacy & Security in the sidebar. (You...
Read more >Chapter 2.1 - Install NodeJS , VS Code and TestCafe on macOS
TestCafe requires the screen recording permission on macOS with the newer version to perform test actions, take a screenshot, and record the videos....
Read more >Handle pop-ups, permissions, and notifications - BrowserStack
Enable or disable pop-ups in Chrome, IE, Edge, and Safari during Selenium tests on BrowserStack Automate.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Using the minus sign was very important. I do wish this tip were in the message that TestCafe logs to the console.
Solved it. it happens when you grant permission to the globally installed testcafe, instead of the one installed in your node_modules. You can grant permissions to the testcafe under:
node_modules/testcafe-browser-tools/bin/mac/TestCafe Browser Tools.appit fixed it for me.