Forum Discussion
nmrao
Champion Level 3
Not sure why the response is required in the report which any way gets saved by the tool if you run the tests from command line.
Like you said, response is too big, what is the use for it? I believe it doesn't even make any difference by writing even small XML.
Just think of what do you lose by not writing response. Instead consider having as many assertions possible to ensure test is passed.
Like you said, response is too big, what is the use for it? I believe it doesn't even make any difference by writing even small XML.
Just think of what do you lose by not writing response. Instead consider having as many assertions possible to ensure test is passed.
roja1
5 years agoContributor
Hi nmrao ,
Thanks for your reply. As per the requirements, we need to get the response in the report.
- HimanshuTayal5 years agoCommunity Hero
roja1 :
What i would suggest is store the request and response into txt files and in your Excel sheet write the link of that excel file.
This way your excel file will look more neat 🙂
- roja15 years agoContributor
Hi HimanshuTayal ,
Thanks for your reply. I'm not saving my response manually. We need to do this through the groovy script
- HimanshuTayal5 years agoCommunity Hero
roja1 ,
What i mean was not to store request and response directly into Excel Sheet cell,
Store your request and response into txt file and in excel cell write the link of the txt file:
def extRequest = context.rawrequest; def requestFile = "REQUEST File Path"; def extResponse = context.response; def responseFile = "RESPONSE File Path"; //Storing Request def rqfile = new File(requestFile); rqfile.write(extRequest, "UTF-8"); //Storing Response def rsfile = new File(responseFile); rsfile.write(extResponse, "UTF-8");
By below command you can add hyperlink in your desired excel cell:
//Styling for hyperlink cell CellStyle hlink_style = workbook.createCellStyle(); Font hlink_font = workbook.createFont(); hlink_font.setUnderline(Font.U_SINGLE); hlink_font.setColor(Font.COLOR_RED); hlink_style.setFont(hlink_font); //adding hyperlink Hyperlink link = createHelper.createHyperlink(Hyperlink.LINK_FILE); Cell cell = null; cell=row.createCell((short) 1); cell.setCellValue("Go to Result"); path_f="TXT FILE PATH"; link.setAddress(path_f); cell.setHyperlink(link);
Related Content
Recent Discussions
- 15 years ago