Can i use *.runsettings file to call the url instead of app.config file RRS feed

  • Question

  • Hello,

    I would like to use test.runsettings file instead of using App.config file to launch the browser.

    Is this possible?

    Is so could be please give me the steps how to create runsettings file and call the url to launch the browser.

    thank you in advance


    Tuesday, June 13, 2017 5:01 PM

All replies

  • Hi PV,

    Thanks for post in MSDN forum.

    As far as I know, we cannot use .runsettings file instead of app.config file in Coded UI Test.

    The .runsettings file is used for configuring unit tests for some purposes.

    I created a simple unit test using .runsettings file in my side, and it could get the output value.

    But, when comes coded UI test, I got the error "Test method UnitTestProject1.CodedUITest1.CodedUITestMethod1 threw exception: System.NullReferenceException: Object reference not set to an instance of an object."

    So it's really a limitation.


    Sorry about this brought you such inconvenience.

    Best regards,


    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

    • Edited by Fletch Zhou Wednesday, June 14, 2017 5:23 AM
    • Proposed as answer by Fletch Zhou Friday, June 16, 2017 1:39 AM
    Wednesday, June 14, 2017 5:23 AM
  • Yes Its possible, you can use runsettings file to read any runtime parameter, all you need to make sure is the method that reads the data from runsettings file is static otherwise you will get null reference exception.

    For detail instructions follow this link : 

    Please "Mark it as answer if it answers your question"

    Wednesday, May 2, 2018 3:55 PM