Search code examples
uibuttonuilabelxctestuicolorxcuitest

Fetch text UIColor in XCUITest


I am writing UI tests from my watchOS project and currently looking how to fetch UIColor attribute from from UILabel and UIButton in XCUIText? Maybe someone knows how to do it?


Solution

  • XCUITest is color-blind. You can either use a snapshot comparison tool or in your application store the color in the accessibility identifier and update it as it changes.