Home » Java » java – How to show excel values in selenium cucumber report-Exceptionshub

java – How to show excel values in selenium cucumber report-Exceptionshub

Posted by: admin February 25, 2020 Leave a comment

Questions:

I am using selenium java ,cucumber with extent report ,I am reading data from excel file. I want to see the excel data in my extent report. How I can do , I am doing in following way but its not showing excel cell value in extent report.
in my feature file

Then  User enters the company name "<CompanyName>" 

In Step file

@Then("^User enters the company name \"([^\"]*)\"$")
    public void user_enters_the_company_name(String arg1) throws Throwable {
        cc.enterCompanyName(arg1);
    }

In page object

public void enterCompanyName(String elem) throws InterruptedException {
        driver.switchTo().frame(0);
        String val = x.getCellData("createCompany", elem, 2);
        WebElement compnyName = driver.findElement(companyName);   
        explicitWait(compnyName);
        compnyName.sendKeys(val);
    }

In report it shows

User enters the company name "CompanyName"

Here i want to see the value which I am passing through excel.

How to&Answers: