如何使用Xamarin UI Test和App Center测量Xamarin应用程序中方法所用的时间

d8tt03nd  于 2022-12-07  发布在  其他
关注(0)|答案(1)|浏览(170)

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.

kwvwclae

kwvwclae1#

这个问题已经解决了,我正在用日期时间写日志。现在代替了开始和停止,然后计算差值

相关问题