Why during the measurement time measurements in Selenium, the function сlick() is handled for so long?

Good day!
began to write the test through selenium+Python+IE
But it happened quite a strange picture - you need to measure the time from clicking on the link to load the page on the link

use:
#
 self.elem = self.driver.find_element_by_link_text("Link")
 self.test01 = time.time() #the first option
self.elem.click()
 self.test02 = time.time() # the second option
 assert "Page link" in self.driver.page_source
 self.test = time.time()
 print(self.test-self.test01) #about 4 seconds
 print(self.test-self.test02) #approximately 0.2 seconds

the actual conclusion of the matter - click what really is processed almost 3 seconds or I something do not understand? explain pliz, maybe there are more simple tools for measurements in this situation
July 2nd 19 at 14:23
1 answer
July 2nd 19 at 14:25
Solution
What do you measure? Why do you need the time between pressing and immediately after? Measure the anchor after clicking.

upd:
Under the anchor I meant that to stop the measurement needed when you wudeli on the page the desired element.
In this example the input field for the Details of the question
For example:

from selenium import webdriver
import time
from datetime import datetime
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

driver.get('https://www.toster.ru')
time.sleep(3)
driver.find_element_by_xpath('//a[@class="btn btn_green btn_add-question"]').click()
time1 = datetime.now()

try:
 element = WebDriverWait(driver, 10).until(
 EC.presence_of_element_located((By.XPATH, "//textarea[@class='field__input textarea']"))
)
finally:
 time2 = datetime.now()

delta = time2 - time1

print(delta)


>>> 0:00:00.649733
See, for example go to the website of the toaster, you want to click the "ask a question" and record how much time I tear the page
Anchor I understand in this case it's the latter, written by me?
Also, do you know why 3 seconds is spent on processing clicks? - ilene46 commented on July 2nd 19 at 14:28
Response updated.

And about 4 seconds - selenium waits when will all the queries. - Ola_Boy commented on July 2nd 19 at 14:31
It is generally understood, but in particular in this example it is not rational to use not "see" the item and "available to"click-through(element_to_be_clickable)? B question a little off topic - if You understand - whether to use the module unittest and the PLO in selenium? Saw the examples, and such and such, but unclear selection criteria and the arguments for and against, or it's just a personal choice? - ilene46 commented on July 2nd 19 at 14:34
In this case, no difference. Can be "seen" or "clickable Lee."
About unittest and the PLO as preferred or as is customary in the company, where you write the framework)
Python is a language in which to automate you can do without OOP.

PS: suggest to add to your bunch and even lettuce\behave. That is to say to DRY)
Good luck - Ola_Boy commented on July 2nd 19 at 14:37

Find more questions by tags Modular testingInternet ExplorerPythonSelenium