SHARE
TWEET

Untitled

a guest Jan 15th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <HTML><HEAD></HEAD>
  2. <BODY>
  3.     <DIV id="time">Time</DIV>
  4. </BODY>
  5. <SCRIPT>
  6.     !function(){
  7.         setInterval(function(){
  8.             document.getElementById('time').innerHTML = new Date();
  9.         }, 500);
  10.     }();
  11. </SCRIPT>
  12. </HTML>
  13.    
  14. ((JavascriptExecutor) driver).executeScript(
  15.     "var r = document.getElementsByTagName('script');" +
  16.     "for(var i = (r.length - 1); i >=0; i--){" +
  17.     "   r[i].parentNode.removeChild(r[i]);" +
  18.     "}");
  19.    
  20. Thread.sleep(2000);
  21.  
  22. ((JavascriptExecutor) driver).executeScript(
  23.     "var newScript = document.createElement("SCRIPT");" +
  24.     "newScript.innerHTML = "document.getElementById('time').innerHTML = 'NEW SCRIPT IS RUNNING';";" +            
  25.     "document.body.appendChild(newScript);");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top