使用CodedUI查找文件下载时间 [英] Finding file download time with CodedUI
问题描述
Hello All,
Hello All,
我有一个要求,我需要知道从Web应用程序下载文件需要多长时间。有人能告诉我,如果使用CodedUI可以获得文件下载时间吗?如果是的话我该怎么做?
I have a requirement where i need to find out how much time did it take to download a file from the web application. Can someone tell me if this is possible with CodedUI to get the file download time ? if yes how can i do this ?
任何和所有输入都赞赏。
Any and all input appreciated.
谢谢,
Utkarsh Gadewar
Utkarsh Gadewar
推荐答案
嗨Utkarsh,
Hi Utkarsh,
谢谢你的提问。
如果有两个控件(或任何可以检测到的内容),这可能代表
开始和结束时间下载,然后我们可以计算持续时间。
If there are two controls(or anything could be detected) which could represent the beginning and the end point time of the downloading, then we could calculate the duration time.
代码如下:
MouseClick(UIDownloadButton);
DateTime t1 = DateTime.Now;
UIcontrol.WaitForControlExist(); //UIcontrol is the control that reprent the downlod file is complete.
DateTime t2 = DateTime.Now;
TimeSpan diff = t2 - t1;
希望有所帮助。
祝你好运,
Fletcher
这篇关于使用CodedUI查找文件下载时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!