Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <script src="webdriver.js"></script>
- <input id="input" type="text"/>
- <script type="application/javascript">
- /*var webdriver = require('selenium-webdriver'),
- SeleniumServer = require('selenium-webdriver/remote').SeleniumServer;
- var server = new SeleniumServer(pathToSeleniumJar, {
- port: 4444
- });*/
- //var webdriver = require('selenium-webdriver');
- window.onload = function(){
- var driver = new webdriver.Builder().
- withCapabilities(webdriver.Capabilities.firefox()).
- build();
- driver.get('http://www.google.com');
- driver.findElement(webdriver.By.name('q')).sendKeys('webdriver');
- driver.findElement(webdriver.By.name('btnG')).click();
- driver.wait(function() {
- return driver.getTitle().then(function(title) {
- return title === 'webdriver - Google Search';
- });
- }, 1000);
- driver.quit();
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement