none
Coded UI test for Windows 10 UWP apps RRS feed

  • Question

  • Hi Team,

    i have created the UWP apps for windows10. Now i am running the code in simulator so i want to know how can i create the test automation for this scenario.

    If this is possible , kindly suggest me specific answers only.

    thanks,

    nItesh

    • Moved by Xavier Xie-MSFT Tuesday, August 23, 2016 2:59 AM move to correct forum
    Monday, August 22, 2016 6:38 AM

Answers

  • Hi NiteshKr12,

    According to your description, I think we could implement your scenario. Because Test Builder for UWP not support recording. So we should implement this through hand-code. Please refer to the following steps:

    1). Start the UWP application.

    2). Giving values to use name and password in UWP application. At this time, we could verify the correctness by querying the database. And we would get a return number 0 or 1.

    3). Click submit button.

    4). Based on the return number add assertion to check whether the popup is Error or welcome screen.

    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.


    Thursday, August 25, 2016 1:25 AM
    Moderator
  • Hi NiteshKr12,

    What’s your meaning of service, is it database? I think in order to add assertion for Error pop-up or welcome screen. We should know the values’ correctness of password before clicking log-in button. Because we could not record the action via Test Builder.

    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 NiteshKr12 Thursday, August 25, 2016 10:39 AM
    Thursday, August 25, 2016 5:50 AM
    Moderator

All replies

  • Hi NiteshKr12,

    As for UWP application, Microsoft has not yet released support for recording step definitions for universal Windows apps. The recorder is there mainly to observe UI elements and to auto-generate code and assertions on elements that have been identified with automation ID.

    We could create a specify Coded UI Test template for UWP application. Please refer to the following screenshot:

    We could launch the UWP application by the following code:

    XamlWindow myAppWindow = XamlWindow.Launch("fc1de054-62b4-46d6-bb4b-e2a4f9fd153e_75cr2b68sm664!App");

    Then capture elements and add assertions through Coded UI Test Builder.

    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.


    Wednesday, August 24, 2016 6:27 AM
    Moderator
  • hi Oscarw Wu,

    thanks for updating. 

    i have a pop or dialog block, which appears when user has enter invalid data in form.

    So how can i create the coded ui test in this scenario.

    any help will be appreciated.

    thanks,

    NItesh

    Wednesday, August 24, 2016 7:19 AM
  • Hi NiteshKr12,

    If a pop or dialog will appear after user enter invalid data. we need to check the input data whether it is right. We could through assertion to implement the situation. Using the cross button in Coded UI Test Builder and Add Assertion for the value you input.

    The following screenshot is a sample, if user type “Hello” then click “Button”, the pop or dialog will be allowed to appeared. You should add an assertion before you click the button.

    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.


    Wednesday, August 24, 2016 9:57 AM
    Moderator
  • hi oscarw wu,

    thanks for updating, but i am doing a bit different thing here.

    I have Username, password field and login button. Now i have added coded ui for entering username and password and click on login button. Now, the credentials will go to service and it will take some time validate. If it is not valid then the Error Popup appears and user clicks on OK button in the popup. Otherwise, the welcome screen appears.

    Kindly point me how can i manage this scenario in coded UI

    Thanks,

    Nitesh

    Wednesday, August 24, 2016 10:53 AM
  • Hi NiteshKr12,

    According to your description, I think we could implement your scenario. Because Test Builder for UWP not support recording. So we should implement this through hand-code. Please refer to the following steps:

    1). Start the UWP application.

    2). Giving values to use name and password in UWP application. At this time, we could verify the correctness by querying the database. And we would get a return number 0 or 1.

    3). Click submit button.

    4). Based on the return number add assertion to check whether the popup is Error or welcome screen.

    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.


    Thursday, August 25, 2016 1:25 AM
    Moderator
  • HI OscarwWu,

    thanks for teh help.

    So as per your description, i have to call the service in test methods.

    thanks,

    NIteshKr12

    Thursday, August 25, 2016 5:42 AM
  • Hi NiteshKr12,

    What’s your meaning of service, is it database? I think in order to add assertion for Error pop-up or welcome screen. We should know the values’ correctness of password before clicking log-in button. Because we could not record the action via Test Builder.

    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 NiteshKr12 Thursday, August 25, 2016 10:39 AM
    Thursday, August 25, 2016 5:50 AM
    Moderator
  • No , it is not database.

    I am calling restfull web service to validate the user which is a async call.

    tahnks,

    nitesh

    Thursday, August 25, 2016 10:09 AM
  • Hi NiteshKr12,

    Yes, we could call interface from web service to prove correctness of password. In your scenario this step should to be implemented.

    If some replies that help you resolve the issue, would you please mark them as answer which could help others who encountered the same issue as you. Thank you very much.

    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.

    Thursday, August 25, 2016 10:26 AM
    Moderator