How to get each Page element load time or response time in selenium?
eg: i was clicking on Ok Button in UI i need to know how much time it was taking for this operation in milliseconds
How to get each Page element load time or response time in selenium?
eg: i was clicking on Ok Button in UI i need to know how much time it was taking for this operation in milliseconds
using System.Diagnostics;
Stopwatch timer = new Stopwatch();
timer.Start();
driver.FindElement("ok button").Click();
timer.Stop();
Console.WriteLine(timer.ElapsedMilliseconds);
If you use java
, you can try this logic:
long before = System.currentTimeMillis();
element.click()
long after = System.currentTimeMillis()-before;
System.out.println("elapsed time :" +after);