Home > Blockchain >  XCode 13.1. Is it possible to take a screenshot of an XCUIElement that doesn't fit in screen?
XCode 13.1. Is it possible to take a screenshot of an XCUIElement that doesn't fit in screen?

Time:03-23

I have a long table with multiple elements within. Is is possible to take a "long" screenshot that will include all elements, not only current screen state?

CodePudding user response:

Unfortunately, no. Xcode is a very unintelligent screenshot tool. You get what’s visible for the screen or element you call it on - no more, no less.

You have two options:

  1. Write code to manually scroll your table a few cells at a time, take a screenshot, and stop when you reach the last element. This obviously results in many screenshots. I’ve not found a smart stitching application that can be run programmatically.
  2. Invest in a third party visual testing framework such as Applitools. They do have this functionality. If you’re small enough or don’t plan on doing much with their software this can be as inexpensive as $free.
  • Related