testcafe-browser-provider-browserstack
testcafe-browser-provider-browserstack copied to clipboard
Unable to take/crop element screenshots on ios testcafe browser stack
Currently when running tests on an iOS device via BrowserStack (iPhone 12 Pro Max, iPhone 11 Pro Max running iOS14) that take screenshots of a specific elements using .takeElementScreenshot() A screenshot of the whole device is captured, but not cropped to the specified element (attached below). I get the following warning message (below).
This works fine when running on an Android device and on desktop browsers where it correctly takes a picture of the element.
As per issue raised here. I am using the environment variable BROWSERSTACK_USE_AUTOMATE: 1 when running the tests to force the automate API.
I am using GitHub actions to run the test.
Warnings (2):
--
Was unable to take a screenshot due to an error.
Error: Unable to locate the page area in the browser window screenshot at
/Users/runner/work/xxx/xxx/screenshots/testscreenshot/iOS/Safari/element/header.png,
because the page area mark with ID 1599151582 is not found in the
screenshot.
at calculateClipInfo
(/Users/runner/work/xxx/xxx/node_modules/testcafe/src/screenshots/crop.js:119:19)
at Object.cropScreenshot
(/Users/runner/work/xxx/xxx/node_modules/testcafe/src/screenshots/crop.js:136:18)
at
/Users/runner/work/xxx/xxx/node_modules/testcafe/src/screenshots/capturer.js:148:40
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at Capturer._capture
(/Users/runner/work/xxx/xxx/node_modules/testcafe/src/screenshots/capturer.js:129:9)
at Capturer.captureAction
(/Users/runner/work/xxx/xxx/node_modules/testcafe/src/screenshots/capturer.js:181:16)
at BrowserManipulationQueue._takeScreenshot
(/Users/runner/work/xxx/xxx/node_modules/testcafe/src/test-run/browser-manipulation-queue.js:54:20)
at BrowserManipulationQueue.executePendingManipulation
(/Users/runner/work/xxx/xxx/node_modules/testcafe/src/test-run/browser-manipulation-queue.js:71:24)
at TestRun.ready-for-browser-manipulation
(/Users/runner/work/xxx/xxx/node_modules/testcafe/src/test-run/index.ts:1261:22)
at TestRun.handleServiceMessage
(/Users/runner/work/xxx/xxx/node_modules/testcafe-hammerhead/lib/session/index.js:70:20)

As I understand you were not able to take a screenshot even with the BROWSERSTACK_USE_AUTOMATE option enabled. We need time to research the issue in detail. Thank you for your report.
This issue has been automatically marked as stale because it has not had any activity for a long period. It will be closed and archived if no further activity occurs. However, we may return to this issue in the future. If it still affects you or you have any additional information regarding it, please leave a comment and we will keep it open.
We're closing this issue after a prolonged period of inactivity. If it still affects you, please add a comment to this issue with up-to-date information. Thank you.