0

I'm trying to automate UI testing of Xamarin forms (Android app emulator) using Xamarin.UI.Tests and Visual Studio 2017.

I created a "Xamarin.UI.Test" project and write a test cases. But Xamarin.UI.Tests are not running when I trying to run the test using visual studio 2017. When trying to run "debug all test" project will start in debug mode and stop immediately. There is no error in error console or output window of VS2017

Abhijith
  • 156
  • 8
  • What does it say in the output window? – vatbub Oct 05 '18 at 15:55
  • Also, do you see your tests in the test explorer? – vatbub Oct 05 '18 at 15:56
  • The output window is blank nothing happening there. – Abhijith Oct 05 '18 at 16:04
  • Yes I can see tests in test explorer – Abhijith Oct 05 '18 at 16:04
  • You can [set a breakpoint](https://learn.microsoft.com/de-de/visualstudio/debugger/using-breakpoints?view=vs-2017) in the first line of your setup method, then right-click on the test in the Text Explorer and click "Debug test". That way, you will know whether the test even launches or not. – vatbub Oct 05 '18 at 16:13
  • Yes did that, but project will start in debug mode and stop suddenly without hitting breakpoint – Abhijith Oct 05 '18 at 16:22
  • Do I need to refer the Android project in UITest project? – Abhijith Oct 05 '18 at 16:23
  • In that case, it's probably an exception that occurs. In the output window, there's a drop-down where you can switch between different output streams. Did you check all of them for any output? Also, have a look at the Errors tab which indicates any compilation issues. – vatbub Oct 05 '18 at 16:25
  • 1
    No, referencing the Android Project is not necessary – vatbub Oct 05 '18 at 16:25
  • There nothing showing in "test" output stream. I also checked the error tab. – Abhijith Oct 05 '18 at 16:30
  • I will try to upload test cases to App center and try to run the test there – Abhijith Oct 05 '18 at 16:31
  • @vatbub I have modified the the Setup method to access the ".apk" file. now the start running. – Abhijith Oct 06 '18 at 05:17

1 Answers1

1

Test not running issue is fix.

I have added ".apk" file path in Test setup method. Now the Test will run and got another error regarding the android sdk not found.

        [SetUp]
        public void BeforeEachTest()
        {
            app = ConfigureApp
              .Android
              .ApkFile(@"..\..\..\HelloWorldXamarinForm\HelloWorldXamarinForm.Android\
                        bin\Debug\App.HelloWorldXamarinForm.apk")
              .StartApp();
        }

Hope this solution will fix the Android SDK path issue

Abhijith
  • 156
  • 8