Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Using ActionSequence to Script Mouse Actions

synthetics-script
developer

#1

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();
});});