Please share your Ans how to do testing for below jsp file like using junit testing?
<%@include file="/libs/foundation/global.jsp"%>
<cq:includeClientLib categories="download" />
<acc:controller cls="com.download.controller.DownloadController"
var="download" />
<c:set var="allLink" value="${download.alllink}" />
DownloadComponent
<div>
<div id="download">
<c:forEach items="${allLink}" var="listBean">
<br>
<input type="checkbox" name="type" id="${listBean.rootPath}">
<a href="${listBean.rootPath}" id="${listBean.rootPath}1" download><br>
<p>${listBean.name}</p>
<br>
<br>
<br> </a>
</c:forEach>
</div>
<br>
<br>
<br> <input type="button" value="Download selected"
onclick="downloadchecked();"> <input type="button"
value="Download all" onclick="downloadall();">
</div>
<script>
function downloadall(){
var image=document.getElementById("download").getElementsByTagName("a");
for(i = 0;i < image.length; i++)
{
image[i].click();
}
};
function downloadchecked(){
var checkedIds = $(":checkbox:checked").map(function() {
return this.id;
}).get();
for(j=0;j<checkedIds.length;j++){
document.getElementById(checkedIds[j]+"1").click();
}
};
</script>