我正在使用范围报告到我的项目,这是报告的方式。
我测试了所有值,它们出现在我的网站上。 我想打印所有登录范围报告。 我编写了代码,但它没有在我的输出HTML文件中生成Log。
任何人都可以建议我如何添加日志?
@Test
public void AnalyticsCode() {
wd.manage().window().maximize();
wd.get("https://www.google.com");
test.log(Status.INFO,"************homePage*********************");
java.lang.String Source = wd.getPageSource();
test.log(Status.INFO,"Google Analytics Code is Present : " + Source.contains("UA-460962-1"));
test.log(Status.INFO,"Google Tag Manager Code is Present : "
+ Source.contains("id=GTM-NKBC"));
wd.close();
wd = new ChromeDriver();
wd.get("https://www.google.com/usa");
test.log(Status.INFO,"************Listpage*********************");
java.lang.String Source_cat = wd.getPageSource();
test.log(Status.INFO,"Google Analytics Code is Present : " + Source_cat.contains("UA-460270-1"));
test.log(Status.INFO,"Google Tag Manager Code is Present : " + Source_cat.contains("id=GTM-NFSBC"));
wd.close();
wd = new ChromeDriver();
wd.get("https://www.google.com/comparison.html");
test.log(Status.INFO,"************IM comparison.html *********************");
java.lang.String Source_com = wd.getPageSource();
test.log(Status.INFO,"Google Tag Manager Code is Present : " + Source_com.contains("GTM-SKBC"));
wd.close();
}