I'm having trouble exporting screenshots using the 'export for localization' feature on Xcode 11. I'm currently working on creating XCUITest suites where I test a certain UI feature of an app, and I want to take screenshots of every page of the app as each test case pass.

I'm using xctestplan, and under Shared Settings->Configurations->UI Testing, I have

  • Automatic Screenshots = On
  • Localization Screenshots = On
  • Attachments = On, and keep all

However, after I run my tests, when I select Editor->Export for Localization, I can not select 'Include Screenshots'. Also, it gives me a yellow warning sign with text like "Screenshot for Localization Issue."

Also, after the tests pass, I can locate the images screenshot.png as attachments listed in the Report Navigator, as well as screenshots taken with title "Localization screenshot", but currently I have no way to export them unless I manually go through it one by one and save each file by right click.

I want to be able to export these screenshots and collect them on a designated directory folder without manually going through all of them to save each image.

I have tried: 1. clean build folder, delete logs in Derived data /users/'ID'/Developer/Xcode/DerivedData 2. run it under UItests scheme as well as the actual app scheme (the executable one) 3. delete all contents and settings on simulator, quit Xcode and restart Mac then restart Xcode

1

There are 1 best solutions below

1
On BEST ANSWER

My workplace open sourced a tool called xcparse that allows you to export out the screenshots from the new xcresult format in Xcode 11 (https://github.com/ChargePoint/xcparse). You can install it Homebrew: brew install chargepoint/xcparse/xcparse