none
How to use .resw resource file in coded UI project RRS feed

  • Question

  • We are developing coded UI automation for UWP application. Want to use .resw file for verifying the translation texts. However we could not add .resw file. Would like to know how to add .resw file and use it in coded UI project for UWP.
    Thursday, May 9, 2019 12:42 PM

All replies

  • Hi Vijay Senniappan,

    Welcome to MSDN forum.

    After many experiments, the .resw file could not be used as embedded source in the code UI test, but the .resx file could be supported.

    ## the difference between them

    Both of they is used as resource for your project. The .resw file is for Windows store app(universal windows) and the .resx file(.Net framework) works for desktop app. The code ui test project is work on the .Net framework.

    Despite the difference of file extension, the .resw file format is identical to the .resx file format, except that .resw files may contain only strings and file paths. You can use the Visual Studio resource editors to create and edit resources. At compile time, all the .resw files for an app are packed into a single PRI file by the MakePRI utility and included with the app's deployment package. Refer more here.

    ## 

    If you want to use the existed .resw file in the coded ui test, you could change the extension of the file from .resw to .resx manually.

    ##How to use the .resx file in coded UI test project?

    Please follow the steps below:

    >1 Right-click the properties in the solution explorer , then add new item, select the Resource File (Or add a existing file, browser the  specific folder, set display all files, then select .resx file)

    >2 Type the following sample code to call the data from the file 

    using System.Resources;
    using CodedUITestProject1.Properties;
    
    ResourceManager testresource = new ResourceManager(typeof(Resource1));
    
    string str = testresource.GetString("String1");//Stirng1 is value Name
    
    Assert.AreEqual(str, "Button");

    Any feedback will be expected.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com



    Friday, May 10, 2019 8:04 AM