473,486 Members | 2,131 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to generate extent report in java?

22 New Member
how to generate extend report

Expand|Select|Wrap|Line Numbers
  1.  
  2.     WebDriver driver;
  3.     static ExtentTest test;
  4.     static ExtentReports report;
  5.  
  6.     @BeforeClass
  7.     public static void startTest()
  8.     {
  9.     report = new ExtentReports(System.getProperty("user.dir")+"\\ExtentReportResults.html");
  10.     test = report.startTest("OrangeHRM");
  11.     System.out.println("befor class");
  12.     }
  13.  
  14.     @AfterClass
  15.     public static void endTest()
  16.     {
  17.     report.endTest(test);
  18.     report.flush();
  19.     }
  20.  
  21.     //Add Candidates
  22.     @Given("^Open Url and login with valid  data$")
  23.     public void open_Url_and_login_with_valid_data() throws Throwable {
  24.         setProperties();
  25.         driver=login();
  26.     }
  27.     @When("^click on recruitment and candidates and verify page$")
  28.     public void click_on_recruitment_and_candidates_and_verify_page() throws Throwable {
  29.         driver.findElement(By.xpath("//*[@id='menu_recruitment_viewRecruitmentModule']/b")).click();
  30.         Thread.sleep(2000);
  31.         driver.findElement(By.xpath("//*[@id='menu_recruitment_viewCandidates']")).click();
  32.         Thread.sleep(2000);
  33.         String Expected_msg=driver.findElement(By.xpath("//*[@id='srchCandidates']/div[1]/h1")).getText();
  34.         String Actual_msg="Candidates";
  35.         Assert.assertEquals(Expected_msg, Actual_msg);
  36.         if(Expected_msg.equals(Actual_msg))
  37.         {
  38.             test.log(LogStatus.PASS, "test pass");
  39.         }
  40.  
  41.         else
  42.         {
  43.             test.log(LogStatus.FAIL, "Test Failed");
  44.         }
  45.     }
  46.     @Then("^click on add buttona and verify page$")
  47.     public void click_on_add_buttona_and_verify_page() throws Throwable {
  48.        driver.findElement(By.xpath("//*[@id='btnAdd']")).click();
  49.        Thread.sleep(2000);
  50.        String Expected_msg=driver.findElement(By.xpath("//*[@id='addCandidateHeading']")).getText();
  51.        String Actual_msg="Add Candidate";
  52.        Assert.assertEquals(Expected_msg, Actual_msg);
  53.     }
  54.     @Then("^Enter all required Detail$")
  55.     public void enter_all_required_Detail() throws Throwable {
  56.        driver.findElement(By.xpath("//*[@id='addCandidate_firstName']")).sendKeys("fname");
  57.        Thread.sleep(2000);
  58.        driver.findElement(By.xpath("//*[@id='addCandidate_middleName']")).sendKeys("mname");
  59.        Thread.sleep(2000);
  60.        driver.findElement(By.xpath("//*[@id='addCandidate_lastName']")).sendKeys("lname");
  61.        Thread.sleep(2000);
  62.        driver.findElement(By.xpath("//*[@id='addCandidate_email']")).sendKeys("abc@gmail.com");
  63.        Thread.sleep(2000);
  64.        driver.findElement(By.xpath("//*[@id='addCandidate_contactNo']")).sendKeys("4578963217");
  65.        Thread.sleep(2000);
  66.     }
  67.     @Then("^click on  Save Button and verify with success mag$")
  68.     public void click_on_Save_Button_and_verify_with_success_mag() throws Throwable {
  69.         driver.findElement(By.xpath("//*[@id='btnSave']")).click();
  70.         String Expected_msg="Successfully Saved"+"\n"+"Close";
  71.             String Actual_msg= driver.findElement(By.className("success")).getText();
  72.         Assert.assertEquals(Expected_msg, Actual_msg);
  73.     }
Jun 27 '19 #1
1 1406
zmbd
5,501 Recognized Expert Moderator Expert
gosai jahnvi:

Why do you expect us to decipher your code and answer a question with so little information?

This is a very simple and basic question - did you do a google search? The following returned About 8,060,000 results in 0.97 seconds :(
https://www.google.com/search?client...ort+in+java%3F

So what specifically is it that you need?
What specifically are the issues you are encountering?
What specifically have you done in an attempt to solve those challenges?

Your questions really read like homework/course work questions and those are not allowed on this site.
Jun 27 '19 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2758
by: Robert Davis | last post by:
I would like to be able to create a recordset in MS Access 2000 that allows a macro to run and create a report for each ID that appears in the recordset. So I thought that I would use a scheduling...
2
3643
by: Jason Huang | last post by:
Hi, I need to generate a report in my ASP.Net 1.1 C#, do we have Crystal Report in the ASP.Net C#? My Database server is SQL Server 2000. What would be the solution? Thanks for help. Jason
5
1834
by: ken | last post by:
how ASP.NET to generate excel report(office 2003) to client what component i need to reference into the asp.net application and what component i need to install to the server? Moreover, does it...
2
1631
by: Shailja | last post by:
Hello, I have developed Drug Management Software in VB. Now I want to generate one report showing the list of all medicine name, Qty, Expiry Date etc. using Crystal Report. Format would be...
3
3850
by: Tarena | last post by:
I have a report that is generated by a query. I have a form with a calendar control. I would like to use the form to force my date range to generate my report. Any suggestions? Do I need to give...
1
1415
by: Perfectdark | last post by:
I have a form where the user can enter 2 Parameters. Now i want to automatically generate a Report according to these parameters. I'm making an SQL Statement and this needs to become the...
0
1313
by: sujithck | last post by:
Hi, is it possible to generate a report using crystal report in C#.net with database as mysql5. Now i can't get the database tables when i design the report. So, how can i browse the...
0
1139
by: Raja yashwanth Reddy Gunda | last post by:
Hi I couldn't generate any report.My application is developed using .Net(MDI Frame application-windows forms) and I am trying to generate the report but couldn't succeed.If I do the same...
0
1269
by: Gurujothi D | last post by:
Dear all,am new to oracle report and oracle forms and i know the basics how to generate the report and to create the form, Now my doubt is, like generating report from oracle report how to...
0
7100
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7126
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6842
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5434
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.