Forum Discussion
roja1
Contributor
Hi nmrao ,
Thanks for your reply. As per the requirements, we need to get the response in the report.
HimanshuTayal
5 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
- 5 years ago
Recent Discussions
- 15 years ago