Skip to main content

Home/ HealthcareMetadata/ Group items tagged injection

Rss Feed Group items tagged

Malcolm McRoberts

Issue 61 - js-test-driver - HTML Injection from separate file - Remote javascript conso... - 0 views

  • I agree with core developers, that there is no need for that to be implemented inside JsTestDriver. Everybody has slightly different needs and this would make configuration complicated. It is easy to solve in JavaScript: * request HTML page with XMLHttpRequest * extract body * inject into the body of the document under test req = new XMLHttpRequest(); req.open('GET', url, false); /* synchronous */ req.send(null); /* body element with children */ body_content = req.responseText.match(/<body[\s\S]*<\/body>/); body = document.documentElement.getElementsByTagName('body')[0]; /* body tag itself is ignored, only its children will be inserted */ body.innerHTML = body_content; } I've documented the full solution at http://www.mobile-web-consulting.de/post/4720306582/jstestdriver-html-injection-from-separate-file
1 - 1 of 1
Showing 20 items per page