Test if UI elements on the Storyboard are localized

Hello!


I want my UI Test method to test if the UI element on the Main.storyboard is localized. But the NSLocalizedString does not seem to read localized strings from the storyboard...


I have a UIViewController on the Main.storyboard. The View Controller has a few UI elements. I have localized the Main.storyboard itself and the localization strings are inside of Main.strings file. When the storyboard is localized its localization Strings have the following format:


/* Class = "UITextField"; placeholder = "Password"; ObjectID = "CAR-iQ-ZyB"; */ 
"CAR-iQ-ZyB.placeholder" = "Password";


I wonder how to read localized Strings from this file(Main.strings) in my UI Test method?

To read localized strings from a Localizable.strings file I usually use the following:


let localizedStringValue = NSLocalizedString(<key here>, bundle: <bundle here>, comment: "")


But this does not work with the localized storyboard strings file(Main.strings).


How to read the localized Main storyboard strings in code?


Thank you very much!

Test if UI elements on the Storyboard are localized
 
 
Q