Skip to content

Instantly share code, notes, and snippets.

@umaar
Created February 17, 2014 14:05
Show Gist options
  • Save umaar/9051143 to your computer and use it in GitHub Desktop.
Save umaar/9051143 to your computer and use it in GitHub Desktop.
Hover over an element in WebDriverJS
/*
* Hover over an element on the page
*/
(function() {
"use strict";
var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().usingServer().withCapabilities({'browserName': 'chrome' }).build();
driver.manage().window().setSize(1280, 1000).then(function() {
driver.get('http://www.shazam.com/discover/track/58858793');
driver.findElement(webdriver.By.css('.ta-tracks li:first-child')).then(function(elem){
driver.actions().mouseMove(elem).perform();
driver.sleep(5000);
driver.quit();
});
});
}());
@ghou1337
Copy link

ghou1337 commented Aug 4, 2022

<3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment