I’m looking for solution to get time to click on element using implicitlyWait in WebDriver (Java)
Example:
Let’s say I will start WebDriver with implicitlyWait = 30 seconds
Afterwards:
webElement.click();
Method click() will wait for element, 30 seconds, and when element will be visible and ready to click->WebDriver will click on it, but how we can take time that WebDriver spend to click on element, any ideas how I can get this value without using any Watch?
Internally, the implicit wait just calls the
findElement()over and over again discarding anyElementNotFoundExceptions until there is an element returned or the time runs out.You could write your own
findElementImplicitlyWait()by doing just that – it’s far from perfect, but it should do the trick.implicitlyWaitto 0.newFindElement()method that calls thefindElement()until it returns an element without throwing an exception or until 30 seconds run out.The code below (hopefully compilable =) ) tries to do that and sout the waiting time.