Use Xamarin C # for app Automation testing on VS

Source: Internet
Author: User

Installation Environment:

1. Install Visual Studio and tick the Xamarin. Plugin, or install the plugin under the Tools-nuget Package management tool:

pm> install-package xamarin.uitest-version 2.0.9
pm> install-package xamarin.testcloud.agent-version 0.20.6 # #ios
pm> Install-package nunittestadapter-version 2.1.1

2. Install Xamarin Test Recorder.
Using Xamarin: Reference: https://developer.xamarin.com/guides/testcloud/uitest/quickstarts/

Positioning elements:

1, using uiautomatorviewer positioning, many elements are not located. Because the page is H5, it is recommended to use Chrome browser.

2, using Chrome browser, install chrome on the phone, open, enter Baidu.

Open chrome on your computer, enter chrome://inspect/#devices, and the elements inside Chrome can be positioned. But the elements inside the APK still can't be located: Show the tab is inactive ... Later find the reason to update again.

3. Open vs Repl, enter the tree command to see the day file displayed on the first line of the command window. The log file has element positioning.

[Test]
This starts up a typically very useful C # REPL that can is used to identify the UI elements.
public void Firstunittest ()
{
App. Repl ();
}

4, using the Xamarin Test Recorder function,

Open the Xamarin Test Recorder, and on the left side of the test file is a small button like a funnel (the left point of the line number) to record. The action element. The recorded script is problematic, but the element can be positioned.

Gesture Action: https://developer.xamarin.com/guides/testcloud/uitest/working-with/gestures/

New project: Visual C #---Test-----UI test App (Xamarin.ui Test | Android

Use Xamarin C # for app Automation testing on VS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.