locked
How to check/test textBox using Coded UI Test RRS feed

  • Question

  • Hi there,

    I was wondering if it was possible to check a textBox for its value? 

    I am setting a value range (for example 0 - 100) as the input for a particular textBox and I have to test it using Coded UI Test to make sure values below or above are not registered/stored. 

    Would it be possible to check a textBox for a certain range of values using Coded UI Test? If so how? If not, any alternatives? 

    I thank you in advance for your time.

    IP

    • Moved by Kristin Xie Wednesday, January 7, 2015 5:58 AM
    Tuesday, January 6, 2015 11:36 AM

Answers

  • Hi Dutrake,

    You can use a property which can display the value which is input in the textbox and verify whether its value is below or above the range.

    For example, if the textbox is a windows forms control, you can use DisplayText.

    You can input a value in the textbox and drag the crosshair on the value within the textbox and check what property displays the input value from the Coded UI Test Builder.

    After you get the value in the textbox, then you can write your own C# code or VB code logic to verify whether the value is in the certain range and the values below or above the range will not be registered/stored. About how to write code to verify the value, you can consult on C# forum or Visual Basic forum and then apply the code logic in coded UI test.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Amanda Zhu Friday, January 9, 2015 3:12 AM
    • Marked as answer by Amanda Zhu Monday, January 12, 2015 2:37 AM
    Wednesday, January 7, 2015 6:53 AM

All replies

  • Hi

    Like your title mentioned, your case related to Code UI, so i will move your thread to Test Tools in Visual Studio 2010 and 2012 forum for better support.

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, January 7, 2015 5:57 AM
  • Hi Dutrake,

    You can use a property which can display the value which is input in the textbox and verify whether its value is below or above the range.

    For example, if the textbox is a windows forms control, you can use DisplayText.

    You can input a value in the textbox and drag the crosshair on the value within the textbox and check what property displays the input value from the Coded UI Test Builder.

    After you get the value in the textbox, then you can write your own C# code or VB code logic to verify whether the value is in the certain range and the values below or above the range will not be registered/stored. About how to write code to verify the value, you can consult on C# forum or Visual Basic forum and then apply the code logic in coded UI test.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Amanda Zhu Friday, January 9, 2015 3:12 AM
    • Marked as answer by Amanda Zhu Monday, January 12, 2015 2:37 AM
    Wednesday, January 7, 2015 6:53 AM