Forum Discussion
weototheheo
11 years agoOccasional Contributor
Hi Tanya,
I measured the finding test object time and Keys event time by using StopWatch for 2 test object as below:
Test Object 1:
// Starts the time counter
StopWatch1 = HISUtils["StopWatch"];
StopWatch1["Start"]();
var startDateControl = page["NativeWebObject"]["Find"]("id", "startDate0_I");
// Stop the time counter and write to text file
StopWatch1["Stop"]();
aqFile["WriteToTextFile"](sPath, "Find Object time:" + StopWatch1["ToString"]()+
"\r\n", aqFile["ctANSI"], false);
// Starts the time counter
StopWatch2 = HISUtils["StopWatch"];
StopWatch2["Start"]();
startDateControl["Click"]();
startDateControl["Keys"]("^a");
startDateControl["Keys"]("[BS]");
startDateControl["Keys"](valueList["Item"]("StartDate"));
// Stop the time counter and write to text file
StopWatch2["Stop"]();
aqFile["WriteToTextFile"](sPath, "Key event time:" + StopWatch2["ToString"]()+
"\r\n", aqFile["ctANSI"], false);
Test Object 2: measurement way is similar to test object 1.
The measurement result is as below:
Object 1:
Find Object time:00:00:38.782
Key event time:00:00:00.858
Object 2:
Find Object time:00:00:41.949
Key event time:00:00:00.780
From above result I found that:
Finding object took a long time(object1: ~38s, object2: ~41s).
Keys event is executed quite fast (object1: ~0.8s, object2: ~0.7s)
I referred [Automated test performance tips] and performced steps as this page guide.
For detail please refer the attached fle.
Thanks,
Automated Test Performance Tips
Automated Test Performance Tips
I measured the finding test object time and Keys event time by using StopWatch for 2 test object as below:
Test Object 1:
// Starts the time counter
StopWatch1 = HISUtils["StopWatch"];
StopWatch1["Start"]();
var startDateControl = page["NativeWebObject"]["Find"]("id", "startDate0_I");
// Stop the time counter and write to text file
StopWatch1["Stop"]();
aqFile["WriteToTextFile"](sPath, "Find Object time:" + StopWatch1["ToString"]()+
"\r\n", aqFile["ctANSI"], false);
// Starts the time counter
StopWatch2 = HISUtils["StopWatch"];
StopWatch2["Start"]();
startDateControl["Click"]();
startDateControl["Keys"]("^a");
startDateControl["Keys"]("[BS]");
startDateControl["Keys"](valueList["Item"]("StartDate"));
// Stop the time counter and write to text file
StopWatch2["Stop"]();
aqFile["WriteToTextFile"](sPath, "Key event time:" + StopWatch2["ToString"]()+
"\r\n", aqFile["ctANSI"], false);
Test Object 2: measurement way is similar to test object 1.
The measurement result is as below:
Object 1:
Find Object time:00:00:38.782
Key event time:00:00:00.858
Object 2:
Find Object time:00:00:41.949
Key event time:00:00:00.780
From above result I found that:
Finding object took a long time(object1: ~38s, object2: ~41s).
Keys event is executed quite fast (object1: ~0.8s, object2: ~0.7s)
I referred [Automated test performance tips] and performced steps as this page guide.
For detail please refer the attached fle.
Thanks,
Automated Test Performance Tips
Automated Test Performance Tips
Related Content
Recent Discussions
- 8 hours agoMW_Didata