How do I execute the below js while running a test case?
function appendHtml(el, str) {
var div = document.createElement(‘div’);
div.innerHTML = str;
while (div.children.length > 0) {
el.appendChild(div.children\[0\]);
}
}
var html = ‘
Some Title
’;appendHtml(document.body, html);