cancel
Showing results for 
Search instead for 
Did you mean: 

How to use extent-report in Ready API tool?

SOLVED
Highlighted
Regular Contributor

Re: How to use extent-report in Ready API tool?

@VeJaay 

 

I am also having simmilar setup like surendermcard 

I have almost 15 test suites and each testsuites has test cases i need to project level report where it can show like test suite and test cases 

 

appreciate any help 

Highlighted
Regular Contributor

Re: How to use extent-report in Ready API tool?

@VeJaay 

 

Any Update here ?

Highlighted
Occasional Contributor

Re: How to use extent-report in Ready API tool?

try this...use globalProperties.setPropertyValuein the setup script at project level and then in the test suite level

use globalProperties.getPropertyValue( "reportPath" )

 

def reportname=com.eviware.soapui.SoapUI.globalProperties.setPropertyValue("reportPath", path)

def path = com.eviware.soapui.SoapUI.globalProperties.getPropertyValue( "reportPath" )

 

hope this helps

Highlighted
Occasional Contributor

Re: How to use extent-report in Ready API tool?

Hi Bheem,

I have generated the extent report

Please find the attachment for the generated extent report.

But  i am unable to get the testSteps present in the Testcase

How to get the Teststeps present in the testcase and also corrresponding assertion should be displayed for the teststep.

 

Please help me in this, required for the client 

Will be waiting for your reply.

Thanks in Advance

ChakriExtentreport.png

Highlighted
Occasional Contributor

Re: How to use extent-report in Ready API tool?

Sadly no 😞 


@678 wrote:

@VeJaay 

 

Any Update here ?


 

Highlighted
Occasional Contributor

Re: How to use extent-report in Ready API tool?

For that you have to write logic to get the test steps and the assertions associated in them.. I dont have the code for that  but its not that tough to find it online... 

I'll share if  I have some working code 

 

Highlighted
Occasional Contributor

Re: How to use extent-report in Ready API tool?

Hi Vejeey

 

Please do share the working code to atleast get the Teststeps present in the Testcase and to be displayed in the extent report so that would be helpful.

Thanks

chakri

Highlighted
Occasional Contributor

Re: How to use extent-report in Ready API tool?

Hi Bheem,

I have generated the extent report

Please find the attachment for the generated extent report.

But  i am unable to get the testSteps present in the Testcase

How to get the Teststeps present in the testcase along with Status, Time Stamp and Details.

 

Please help me in this, required for the client 

Will be waiting for your reply.

Thanks in Advance

Chakri

Highlighted
Occasional Contributor

Re: How to use extent-report in Ready API tool?

Try this

// This will get the list of all testSteps in the testCase
def testSteps = context.testCase.getTestStepList()
testSteps.each{
// This block will loop through the test steps and print the test step name to the log
log.info(it.name)
}
Highlighted
Occasional Contributor

Re: How to use extent-report in Ready API tool?

Capture.PNGimport com.relevantcodes.extentreports.ExtentReports; import com.relevantcodes.extentreports.ExtentTest; import java.text.SimpleDateFormat def date = new Date() sdf = new SimpleDateFormat("dd_MM_yyyy_HHmmss") def start_time = sdf.format(date) log.info(start_time) def LogStatus = com.relevantcodes.extentreports.LogStatus; def path = "C://Users//chakradharyadav.m//Desktop//SampleReport//Extent_Reports//API_Testing_"+start_time+".html" log.info(path) def failedTestCase = 0; def extent = new ExtentReports(path,false) extent.addSystemInfo("Report Name", "API Test Automation").addSystemInfo("Report Type", "Automation Report"); runner.results.each { testCaseResult -> def name = testCaseResult.testCase.name log.info name // This will get the list of all testSteps in the testCase def testSteps = context.testCase.getTestStepList() testSteps.each{ // This block will loop through the test steps and print the test step name to the log log.info(it.name) } def extentTest = extent.startTest("$name", "$name") if(testCaseResult.status.toString() == 'FAILED') { failedTestCase++ extentTest.log(LogStatus.FAIL,testSteps, testCaseResult.testCase.name) } else { extentTest.log(LogStatus.PASS,testSteps, testCaseResult.testCase.name) } extent.endTest(extentTest); } extent.flush();

 

 

When i execute the code after adding the teststeps extent report is blank.

 

Please guide me for add the teststeps present in the testcase for the extent report

Thanks in advance

will be awaiting for the reply

 

Thanks

chakri

 

New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
Check out this week's challenge!

Create a script to generate an email when an assertion fails for the TechCorner tag!


Scripts created in July:
- A script to change the request body before sending it to the server
Top Kudoed Authors