Using ActionSequence to Script Mouse Actions

This example shows how to use ActionSequence to move the mouse around the screen. Full actions available are documented in our Synthetics reference here: https://docs.newrelic.com/docs/synthetics/new-relic-synthetics/scripting-monitors/synthetics-scripted-browser-reference#actionsequence

$browser.get('http://www.w3schools.com/cssref/tryit.asp?filename=trycss_sel_hover').then(function(){
  
  console.log('switch iframe');
  return $browser.switchTo().frame('iframeResult');
}).then(function(){
  console.log('find element');
  return $browser.findElement($driver.By.css('body > a:nth-child(2)')).then(function(element){
    console.log('mouseover');
    return $browser.actions().mouseMove(element).perform();
});});
3 Likes