none
Coded UI Test for UWP and windows phone apps RRS feed

  • Question

  • Hello, 

    I'm writing UI Test code for sample windows app, UWP. Could you please tell me how to write a code to enter the values in textboxes and how to scrolldown/up or swipe the screen.

    Thanks in advance.

    • Moved by Martin Zhema Tuesday, September 20, 2016 9:18 AM move to correspondent forum
    Tuesday, September 20, 2016 1:16 AM

Answers

  • Hi SJ87,
    For UI test UWP apps, we could create different Coded UI Test Project, one for Windows Phone one for Windows app.
    You can see the following link:
    http://stackoverflow.com/questions/25872022/coded-ui-test-windows-universal-apps
    >>how to write a code to enter the values in textboxes
    You can refer to the link below, it may helpful for you:
    https://msdn.microsoft.com/en-us/library/dn305948.aspx
    And the following code can access the value of textbox:

    public void AssertMethod1()
    {
        #region Variable Declarations
        XamlEdit uITextBoxEdit = this.UIApp1Window.UITextBoxEdit;
        #endregion
    
        // Verify that the 'Text' property of 'textBox' text box equals 'button'
        Assert.AreEqual(this.AssertMethod3ExpectedValues.UITextBoxEditText, uITextBoxEdit.Text);
    }
    


    >>how to scrolldown/up or swipe the screen.
    You can refer to the link below and you can use Gesture here:
    https://blogs.msdn.microsoft.com/visualstudioalm/2013/08/16/coded-ui-test-gesture-support-in-visual-studio-2013/


    Best Regards!
    Martin
    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.

    Tuesday, September 20, 2016 9:07 AM
  • Hi SJ87,

    The UWP forum does not support Coded UI Test, I will move the thread to the corresponding forum.


    Best Regards!
    Martin
    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.

    • Marked as answer by SJ87 Monday, October 17, 2016 10:14 PM
    Tuesday, September 20, 2016 9:24 AM
  • Thanks Martin
    • Marked as answer by SJ87 Monday, October 17, 2016 10:14 PM
    Thursday, September 22, 2016 9:45 PM
  • Hi SJ87,

    If a reply that help you resolved the issue, would you please mark it as answer which could help others who encountered the same issue as you.

    Sincerely,

    Oscar


    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.

    • Marked as answer by SJ87 Monday, October 17, 2016 10:14 PM
    Friday, September 23, 2016 1:07 AM
    Moderator

All replies

  • Hi SJ87,
    For UI test UWP apps, we could create different Coded UI Test Project, one for Windows Phone one for Windows app.
    You can see the following link:
    http://stackoverflow.com/questions/25872022/coded-ui-test-windows-universal-apps
    >>how to write a code to enter the values in textboxes
    You can refer to the link below, it may helpful for you:
    https://msdn.microsoft.com/en-us/library/dn305948.aspx
    And the following code can access the value of textbox:

    public void AssertMethod1()
    {
        #region Variable Declarations
        XamlEdit uITextBoxEdit = this.UIApp1Window.UITextBoxEdit;
        #endregion
    
        // Verify that the 'Text' property of 'textBox' text box equals 'button'
        Assert.AreEqual(this.AssertMethod3ExpectedValues.UITextBoxEditText, uITextBoxEdit.Text);
    }
    


    >>how to scrolldown/up or swipe the screen.
    You can refer to the link below and you can use Gesture here:
    https://blogs.msdn.microsoft.com/visualstudioalm/2013/08/16/coded-ui-test-gesture-support-in-visual-studio-2013/


    Best Regards!
    Martin
    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.

    Tuesday, September 20, 2016 9:07 AM
  • Hi SJ87,

    The UWP forum does not support Coded UI Test, I will move the thread to the corresponding forum.


    Best Regards!
    Martin
    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.

    • Marked as answer by SJ87 Monday, October 17, 2016 10:14 PM
    Tuesday, September 20, 2016 9:24 AM
  • Thanks Martin
    • Marked as answer by SJ87 Monday, October 17, 2016 10:14 PM
    Thursday, September 22, 2016 9:45 PM
  • Hi SJ87,

    If a reply that help you resolved the issue, would you please mark it as answer which could help others who encountered the same issue as you.

    Sincerely,

    Oscar


    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.

    • Marked as answer by SJ87 Monday, October 17, 2016 10:14 PM
    Friday, September 23, 2016 1:07 AM
    Moderator