How to wait until all network logs in generated?

丶灬走出姿态 提交于 2020-02-06 18:04:39

问题


I am using Selenium and Java for my tests. After a test completes, I download the HAR file which I later use for analyzing certain domains that exist in the page. I found that the HAR file that I download doesn't contain complete log of all the requests for that page. How do I wait until entire network traffic for a page completes before downloading the HAR file?

I did try to use wait before downloading the HAR file but didn't work. Can you suggest some other ideas?

WebDriverWait wait = new WebDriverWait(driver, 60);
wait.until(ExpectedConditions.jsReturnsValue("return document.readyState==\"complete\";"));

来源:https://stackoverflow.com/questions/58536303/how-to-wait-until-all-network-logs-in-generated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!