Currently, I am using selenium grid for run test case parallel on remote pc.And I am using extend report for generating a report.Suppose I run the same test case on two different PC with two different browsers.I want to generate the report for two separate browsers on the separate file.
Using this code I run my automation on the remote computer.
@Parameters("browser")
@BeforeMethod
public void launchbrowser(String browser) throws MalformedURLException {
if (browser.equalsIgnoreCase("firefox")) {
System.out.println(" Executing on FireFox");
String Node = "http://192.168.2.105:5555/wd/hub";
DesiredCapabilities cap = DesiredCapabilities.firefox();
cap.setBrowserName("firefox");
wd = new RemoteWebDriver(new URL(Node), cap);
// Puts an Implicit wait, Will wait for 10 seconds before throwing
// exception
wd.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
// Launch website
wd.navigate().to(URL);
wd.manage().window().maximize();
}
This code generate my extend report instead of testng reporting.
@BeforeTest
public void setUp() {
// where we need to generate the report
String fileName = new SimpleDateFormat("dd-MM-yyyy").format(new Date());
htmlReporter = new ExtentHtmlReporter("C:/xampp/htdocs/Automation_report/files/alojamento/alojamento("+fileName+").html");
extent = new ExtentReports();
extent.attachReporter(htmlReporter);
// Set our document title, theme etc..
htmlReporter.config().setDocumentTitle("Alojamiento");
htmlReporter.config().setReportName("Alojamiento Production Testing");
htmlReporter.config().setTestViewChartLocation(ChartLocation.TOP);
htmlReporter.config().setTheme(Theme.DARK);
}
This is the reporting format,Actually i upload it because i want to show why i use this reporting.Use it For GUI
Can you please suggest me how can i archive my goals?
As per your code, you are launching the browser under @beforeMethod. So you need to implement your report under same annotation itself.