cancel
Showing results for 
Search instead for 
Did you mean: 

readyapi report

SOLVED
Occasional Contributor

readyapi report

how to creare ready API report in that

Requirement -

1)testsuite name

2)teatcase name

3)test step name

4)request response for pass and fail test steps

5)method

6)Statuscode

All are required

please help in that

tool not provide enough information in the report

 

3 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Hero

Re: readyapi report

Not a clear question.
What type of report are you looking? junit, pdf or something else?


Regards,
Rao.

View solution in original post

Highlighted
Occasional Contributor

Re: readyapi report


@nmrao wrote:
Not a clear question.
What type of report are you looking? junit, pdf or something else

 

please find attached image.


 

View solution in original post

Highlighted
Occasional Contributor

Re: readyapi report

Pdf type report needed

Also shows pass test case - green color and fail  test case - red

below code is not sufficient for that plaese help in that

// Below code goes in set up script tab

FileWriter file = new FileWriter("D:/udm/reporting/Report.html")
def str = '''<HTML>
	<HEAD>
		<meta charset='UTF-8'>
			<title>WEBSERVICE TEST AUTOMATION REPORT</title>
			<style>
				.demo {
					border:1px solid #C0C0C0;
					border-collapse:collapse;
					padding:5px;
				}
				.demo th{
					border:1px solid #C0C0C0;
					padding:5px;
					background:#E0F0F1;
				}
				.demo td{
					border:1px solid #C0C0C0;
					padding:5px;
					background:white;
				}
			</style>
	</Head>
	
	<table class="demo">
		<h3> WEBSERVICE TEST AUTOMATION REPORT</h3>
			<thead>
				<tr>
					<th>Test Step</th>
					<th>Method</th>
					<th>Status Code</th>
					<th>Endpoint</th>
				</tr>
			</thead>
			
			<tbody>'''
file.write(str)
file.close()


// Below code goes in TearDown script tab

FileWriter file = new FileWriter("D:/udm/reporting/Report.html", true)
def testStepName
def method
def statusCode
def endpointURL
def str

testCase.testStepList.each{
	testStepName = it.name
	method = it.getHttpRequest().getResponse().getMethod()
	statusCode = it.testRequest.response.responseHeaders["#status#"][0]
	endpointURL  = it.getHttpRequest().getResponse().getURL()

	str = "<tr><td>${testStepName}</td><td>${method}</td><td>${statusCode}</td><td>${endpointURL}</td></tr>"
	file.append(str)
}

file.append("</tbody></table></HTML>")
file.close()

color 

 

View solution in original post

4 REPLIES 4
Highlighted
Community Hero

Re: readyapi report

Not a clear question.
What type of report are you looking? junit, pdf or something else?


Regards,
Rao.

View solution in original post

Highlighted
Occasional Contributor

Re: readyapi report


@nmrao wrote:
Not a clear question.
What type of report are you looking? junit, pdf or something else

 

please find attached image.


 

View solution in original post

Highlighted
Occasional Contributor

Re: readyapi report

Pdf type report needed

Also shows pass test case - green color and fail  test case - red

below code is not sufficient for that plaese help in that

// Below code goes in set up script tab

FileWriter file = new FileWriter("D:/udm/reporting/Report.html")
def str = '''<HTML>
	<HEAD>
		<meta charset='UTF-8'>
			<title>WEBSERVICE TEST AUTOMATION REPORT</title>
			<style>
				.demo {
					border:1px solid #C0C0C0;
					border-collapse:collapse;
					padding:5px;
				}
				.demo th{
					border:1px solid #C0C0C0;
					padding:5px;
					background:#E0F0F1;
				}
				.demo td{
					border:1px solid #C0C0C0;
					padding:5px;
					background:white;
				}
			</style>
	</Head>
	
	<table class="demo">
		<h3> WEBSERVICE TEST AUTOMATION REPORT</h3>
			<thead>
				<tr>
					<th>Test Step</th>
					<th>Method</th>
					<th>Status Code</th>
					<th>Endpoint</th>
				</tr>
			</thead>
			
			<tbody>'''
file.write(str)
file.close()


// Below code goes in TearDown script tab

FileWriter file = new FileWriter("D:/udm/reporting/Report.html", true)
def testStepName
def method
def statusCode
def endpointURL
def str

testCase.testStepList.each{
	testStepName = it.name
	method = it.getHttpRequest().getResponse().getMethod()
	statusCode = it.testRequest.response.responseHeaders["#status#"][0]
	endpointURL  = it.getHttpRequest().getResponse().getURL()

	str = "<tr><td>${testStepName}</td><td>${method}</td><td>${statusCode}</td><td>${endpointURL}</td></tr>"
	file.append(str)
}

file.append("</tbody></table></HTML>")
file.close()

color 

 

View solution in original post

Highlighted
Occasional Contributor

Re: readyapi report

I attached aan image of report which type of I needed.

Report type - pdf also I add a script