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.
1条答案
按热度按时间kwvwclae1#
这个问题已经解决了,我正在用日期时间写日志。现在代替了开始和停止,然后计算差值