Forum Xamarin Cross Platform with Xamarin

How to manipulate data from my UI test environment?

First of all, a sincere greeting to the members of this forum. I am currently testing an application and created two test projects:

The first one is focuses on the app logic I have called AppName.Tests.
While the second one is focuses on the user interface, I have called this AppName.UITests.

I would like to know if I can go directly to the components to test them, I would like to invoke them and pass them a list or any type of binding information to a property. Example UserDialogs.ActionSheet(title, cancel, buttons);

Is it possible using Xamarin.UITest?

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai

    I would like to know if I can go directly to the components to test them

    Use app.Query to retrieve elements. Then we could access its property like Text.
    If you want to test click event of button we could use Tap:
    https://docs.microsoft.com/zh-cn/dotnet/api/xamarin.uitest.iapp.tap?view=xamarin-uitest-sdk
    But I think UserDialogs.ActionSheet(title, cancel, buttons); this should be initialized in Forms and we could fire button's click event to show it up.

  • TeofiloTeofilo USMember

    Let me explain myself better, I already know how to use the tap and the query, but my application is something big and I don't want to wait for some windows to run the tests, instead I would like to invoke some public methods within my shared project and invoke them so that Fill in the test lists that I already have predefined.

  • LandLuLandLu Member, Xamarin Team Xamurai

    If you want to test some certain pages we have to write down the logic code in the Forms project. Navigate to them directly from the main page then you could skip some unnecessary pages.
    I think we should start with the basic projects instead of the test projects.

Sign In or Register to comment.