-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathLearnER.java
More file actions
42 lines (35 loc) · 1.27 KB
/
LearnER.java
File metadata and controls
42 lines (35 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package ExtentReport.learnER;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.*;
import com.aventstack.extentreports.ExtentReports;
import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
public class LearnER {
ExtentReports extent;
@BeforeTest
public void config()
{
//We need to class ExtentReport and
//extentSparkReporter() : for creating reports, we need to give path where report file generated
//to create directory via command
String path= System.getProperty(("user.dir")+"\\reports\\index.html");
ExtentHtmlReporter sr=new ExtentHtmlReporter(path);
sr.config().setReportName("My First Report");
sr.config().setDocumentTitle("Extent Report");
extent=new ExtentReports();
extent.attachReporter(sr);
extent.setSystemInfo("Tester", "Radhika");
}
@Test
public void InitialDemo()
{
extent.createTest("Initial Test");
System.setProperty("webdriver.chrome.driver","D:\\Eclipse\\CourseWorkspace\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
String url="www.google.com";
driver.get(url);
//System.out.println(driver.getTitle());
extent.flush();
driver.quit();
}
}