Skip to content

Instantly share code, notes, and snippets.

@Harkishen-Singh
Forked from umaar/webdriver-hover.js
Created March 15, 2019 18:45
Show Gist options
  • Save Harkishen-Singh/d8926972e1c29a007a1b7a1aa7059c1b to your computer and use it in GitHub Desktop.
Save Harkishen-Singh/d8926972e1c29a007a1b7a1aa7059c1b 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();
});
});
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment