【发布时间】:2021-09-13 22:58:48
【问题描述】:
我正在尝试在页面加载完成并完成所有 jquery 后截取屏幕截图。该页面在 IE、Edge 和 FireFox 中加载,但所有三种浏览器偶尔都会运行 jquery 有点慢,我得到一个 trasitional image 的 jquery 工作。
start_time = time.perf_counter()
ClickActionElement = Utility_Element_Verify.ID_Element(self,
ElementID = ElementID,
ElementDescription = ElementDescription)
webdriver.ActionChains(self.driver).move_to_element(ClickActionElement).perform()
webdriver.ActionChains(self.driver).move_to_element(ClickActionElement).click(ClickActionElement).perform()
WebDriverWait(self.driver, 30).until(EC.presence_of_element_located((By.ID , WaitElementID)))
end_time = time.perf_counter()
time_elapsed = (end_time - start_time)
self.TestEventLog += "<br />LoadTime: Admin page and the Specific Ajax was completed before: " + str(time_elapsed) + " seconds"
在我截屏之前,我应该怎么做才能确保 jquery 在这里完成?
Utility_Capture_Screen.CaptureScreen(self) # sometimes it's to fast
图像已保存,但有时 jquery 尚未完成。如何检测 jquery 是否已完成?
【问题讨论】:
标签: python jquery selenium bootstrap-4