[英]Clear Network tab using Selenium Java
I am trying to load a page, and I am automating the process of checking for a POST request after a button is clicked.我正在尝试加载页面,并且在单击按钮后自动检查 POST 请求的过程。
In order to do this, I need to clear the Network tab of all previous entries before the button is clicked, otherwise it will not show up on the list for some reason.为此,我需要在单击按钮之前清除所有先前条目的网络选项卡,否则由于某种原因它不会显示在列表中。
Is there a way to do this via logging or some other means in Selenium Java?有没有办法通过日志记录或 Selenium Java 中的其他方式来做到这一点?
As far as I know, there is no way to interact with Chrome's dev tools as you intent to.据我所知,没有办法按照您的意图与 Chrome 的开发工具进行交互。 Alhough, if you are interested in obtaining/parse data from the Network tab in Chrome you can do that following their quick tutorial in their website here .
不过,如果您有兴趣从 Chrome 中的“网络”选项卡获取/解析数据,您可以按照他们网站上的快速教程进行操作。
I don't know what is you idea but here I leave you 2 cents.我不知道你有什么想法,但在这里我给你 2 美分。 Perhaps you could access this data and work it elsewhere instead of constant refreshing.
也许您可以访问这些数据并在其他地方工作,而不是不断刷新。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.