Advertisement
dimti

Untitled

Mar 17th, 2016
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.86 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <script src="webdriver.js"></script>
  3. <input id="input" type="text"/>
  4. <script type="application/javascript">
  5. /*var webdriver = require('selenium-webdriver'),
  6.     SeleniumServer = require('selenium-webdriver/remote').SeleniumServer;
  7.  
  8. var server = new SeleniumServer(pathToSeleniumJar, {
  9.     port: 4444
  10. });*/
  11.  
  12. //var webdriver = require('selenium-webdriver');
  13. window.onload = function(){
  14. var driver = new webdriver.Builder().
  15.         withCapabilities(webdriver.Capabilities.firefox()).
  16.         build();
  17.  
  18. driver.get('http://www.google.com');
  19. driver.findElement(webdriver.By.name('q')).sendKeys('webdriver');
  20. driver.findElement(webdriver.By.name('btnG')).click();
  21. driver.wait(function() {
  22.     return driver.getTitle().then(function(title) {
  23.         return title === 'webdriver - Google Search';
  24.     });
  25. }, 1000);
  26.  
  27. driver.quit();
  28. }
  29. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement