Created
March 7, 2018 09:35
-
-
Save hiepxanh/74eea6a54a93cc00ebd88115aa038361 to your computer and use it in GitHub Desktop.
selenium javascript hover button with async await
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async login(driver:WebDriver) { | |
await driver.get('https://tiki.vn'); | |
let loginElement = await driver.findElement(By.id('header-user')); | |
let strJavaScript = "var element = arguments[0];" | |
+ "var mouseEventObj = document.createEvent('MouseEvents');" | |
+ "mouseEventObj.initEvent( 'mouseover', true, true );" | |
+ "element.dispatchEvent(mouseEventObj);"; | |
await driver.executeScript(strJavaScript, loginElement); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment