0

I have recently added a Xamarin UI Test project for my Xamarin app and configured it with App Center to run the test automation on App center and I need to measure how much time is taken by a method or api call to process and show the result and getting this time in the form of logs for load testing.

For e.g After clicking a search button how much time the api took to display the results? How can I measure this?

I tried using this code

var st = new Stopwatch();
st.Start();
app.Tap("SearchButton");
                
var element = app.WaitForElement(q => q.Marked("Got Results"), "Time Out occured", new TimeSpan(0,0,50));

st.Stop();
var time = st.ElapsedMilliseconds;

the 'SearchButton' click is actually taking 30secs to process the api call and display results in UI but the 'time' variable is not counting it.

I appreciate any help on this issue.

Siddhant maurya
  • 261
  • 1
  • 2
  • 12

1 Answers1

0

The issue is fixed I am writing logs using DateTime.Now in place of start and stop and then calculating the difference

Siddhant maurya
  • 261
  • 1
  • 2
  • 12