Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I stop Xamarin.UITest removing data between Tests?

I have written some UITests for my Xamarin application using Xamarin.UITest I am trying to split my tests into individual Tests but sometimes the tests I run remove the previous data and my application goes back to the start-up proccess.

I have added the Xamarin.UITest.Configuration.AppDataMode.DoNotClear attribute to the StartApp but this does not work all the time:

app = ConfigureApp.Android.ApkFile(PathToAPK).WaitTimes(new WaitTimes()).EnableLocalScreenshots().StartApp(Xamarin.UITest.Configuration.AppDataMode.DoNotClear);

When does UITest clear the application data and how can I stop it?

like image 551
User1 Avatar asked Dec 04 '25 13:12

User1


1 Answers

Ok So the setting the setting Xamarin.UITest.Configuration.AppDataMode.DoNotClear in the StartApp method does stop your application clearing the data in between tests.

But If you change your application and rebuild it then the new application will overwrite the old one clearing the data,

Or if you run the Xamarin Test Recorder this will also wipe the data.

Which makes developing these tests horrendous!

like image 157
User1 Avatar answered Dec 08 '25 05:12

User1



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!