Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法覆盖或扩展本机 Selenium WebDriver 操作,如“单击”或“发送键”以用于日志记录?因此,在执行常规 click 或 sendKeys 后,将触发以下代码:
Logger log = Logger.getLogger(className); log.setLevel(logLevel); log.info(strButtonName + " was clicked");
确切的实现将取决于语言,但您应该能够创建一个继承 WebDriver 的类,然后添加扩展方法或重载来执行单击和记录操作。