{"id":16283468,"url":"https://github.com/damiansuess/test.uitests","last_synced_at":"2025-04-08T18:25:41.435Z","repository":{"id":143243137,"uuid":"196899083","full_name":"DamianSuess/Test.UITests","owner":"DamianSuess","description":"Xamarin.UITest sample application","archived":false,"fork":false,"pushed_at":"2020-01-13T19:58:56.000Z","size":331,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-14T14:42:44.576Z","etag":null,"topics":["nunit","unit-testing","xamarin","xamarin-android","xamarin-forms","xamarin-uitest","xeno-innovations"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DamianSuess.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-15T00:54:52.000Z","updated_at":"2021-05-21T00:58:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"f30cc329-7737-4ad6-82aa-61d435b048c2","html_url":"https://github.com/DamianSuess/Test.UITests","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamianSuess%2FTest.UITests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamianSuess%2FTest.UITests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamianSuess%2FTest.UITests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamianSuess%2FTest.UITests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DamianSuess","download_url":"https://codeload.github.com/DamianSuess/Test.UITests/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247900202,"owners_count":21015032,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nunit","unit-testing","xamarin","xamarin-android","xamarin-forms","xamarin-uitest","xeno-innovations"],"created_at":"2024-10-10T19:13:31.081Z","updated_at":"2025-04-08T18:25:41.411Z","avatar_url":"https://github.com/DamianSuess.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Xamarin UITest Sample\n\nThis is a sample project for Xamarin.Forms UITests and aims to provide a simple setup and configuration guide\n\nAuthor: [Damian Suess](https://www.linkedin.com/in/damiansuess/)\n\n## NuGet Requirements\n* NUnit (v3)\n* NUnit3TestAdapters\n* Xamarin.UITest\n\n## Step 1 - Setup Environment\n1. Set your Environment Variables\n    * ANDROID_HOME=``\"C:\\Program Files (x86)\\Android\\android-sdk\"``\n    * JAVA_HOME=``\"C:\\Program Files\\Android\\jdk\\microsoft_dist_openjdk_1.8.0.25\"``\n2. Create a main Xamarin.Forms project\n3. Create your UTests project\n    * Include the required NuGet packages above!\n4. Create your first test\n\n## Step 2 - Creating a Test\n1. Create your ``AppInitializer.cs``\n2. Create tests with the *AAA* principal\n    * Arrange - _your variables_\n    * Act - _perform actions_\n    * Assert - _validate your actions_\n\n\n# Pain Points\nDid you ever get, ``The running adb server is incompatible with the Android SDK version in use by UITest``?\n\nThis message is CRAP because it can mean a number of problems\n\n## Some Solutions\n### Environemnt Variables\n* Make sure your environment variable ``ANDROID_HOME`` is set correctly\n* Make sure your environment variable ``JAVA_HOME`` is set correctly\n\n### ADB Version\nEnsure you have the right ADB version running. Currently Xamarin.UITest v3.0 wants to use ADB v1.0.39. Even better, they don't tell you which one it wants?!\n\nBut wait, it's July-2019 and the latest ADB is v1.0.40?!  Yes, i know. You may have to do the following\n\n1. Navigate to %ANDROID_HOME%\\\n2. Validate your ADB version in the ``platform-tools`` folder\n    * PowerShell: ``adb version``\n    * Output: ``Android Debug Bridge version 1.0.40``\n3. Find the right version in the obscurely named \"platform-tools.old#######\" folders\n    * Currently, it wants ``v1.0.39``. Find it\n4. Backup your old ``platform-tools`` folder by renaming it\n5. Rename your ``..old-..`` as your **platform-tools**\n    * I did a copy of the old folder \u0026 renamed it\n\n### Generic Error Bullcrap\n```\nMessage: System.Exception : The running adb server is incompatible with the Android SDK version in use by UITest:\n    C:\\Program Files (x86)\\Android\\android-sdk\n\nYou probably have multiple installations of the Android SDK and should update them or ensure that your IDE, simulator and shell all use the same instance.  The ANDROID_HOME environment variable can effect this.\n```\n### Choosing the right emulator\nIf you ever get the following\n```\nMessage: System.Exception : Configured device serial 'emulator-5554' not found. DeviceSerial does not need to be specified if only 1 device is connected. Devices found: emulator-5556\n```\n\nTry setting the ``.DeviceSerial(\"emulator-5554\")`` in your ``AppInitializer.cs`` file\n```cs\n  return ConfigureApp\n    .Android\n    .InstalledApp(\"com.companyname.Test.UITests\")\n    .EnableLocalScreenshots()\n    .DeviceSerial(\"emulator-5554\") // To run specific device\n    .StartApp(Xamarin.UITest.Configuration.AppDataMode.Clear);\n```\n\n\n# Further Learning\n## Resources\n* [Working with Xamarin.UITest](https://docs.microsoft.com/en-us/appcenter/test-cloud/uitest/working-with)\n* https://theconfuzedsourcecode.wordpress.com/2018/10/28/getting-your-xamarin-uitests-to-actually-work-not-thanks-to-xamarin-docs/\n\n### Learn\n* [Using UITest](https://developer.xamarin.com/samples/xamarin-forms/UsingUITest/)\n* Samples\n    * https://medium.com/@frankiefoo/xamarin-forms-how-to-perform-automated-ui-test-254a01c87648\n        * [Sample 1](https://github.com/xyfoo/learn-xamarin-ui-test/blob/master/XamarinFormsHelloWorld.UITest/Tests.cs)\n    * https://github.com/brminnick/UITestSampleApp\n    * https://theconfuzedsourcecode.wordpress.com/2018/10/28/getting-your-xamarin-uitests-to-actually-work-not-thanks-to-xamarin-docs/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamiansuess%2Ftest.uitests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdamiansuess%2Ftest.uitests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamiansuess%2Ftest.uitests/lists"}