这里介绍的是TestNG中的Report类来实现简单的log输出这个很简单直接看例子吧

 

package com.rrx.test;

import java.io.IOException;

import org.openqa.selenium.WebDriver;
import org.testng.Reporter;
import org.testng.annotations.Test;

import com.rrx.framework.BorwserEngin;

public class NewTest {
@Test
public void f() throws IOException {
BorwserEngin borwser=new BorwserEngin();
Reporter.log("我在打印日志");
WebDriver driver = borwser.getDriver();
driver.quit();
Reporter.log("我退出浏览器了");


}
}

运行后,找到报告,打开发现中文的日志

TestNG实现日志输出

相关文章:

  • 2022-02-17
  • 2021-11-05
  • 2021-08-14
  • 2022-12-23
  • 2021-08-12
  • 2021-07-01
猜你喜欢
  • 2022-12-23
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2021-12-30
相关资源
相似解决方案