scroll

You can use the scroll method to scroll horizontally and vertically on a page.

Usage

scroll(<X_position>, <Y_position>)
scroll.vertical(<Y_position>)
scroll.horizontal(<X_position>)

Please review the following examples.

/* LIBRARIES
*************/
const { sente } = require('#libraries');
const { scroll, go } = sente;


/* TEST FLOW
*************/

test = async () => {
   
    await go('https://v17.angular.io/guide')

    // Scroll Down 500 Pixels 
    await scroll(0,500)
    
    // Scroll Down 500 Pixels 
    await scroll.vertical(500)
    
    // Scroll Right 500 Pixels 
    await scroll(500,0)
    
    // Scroll Right 500 Pixels 
    await scroll.horizontal(500)
    
    // Scroll Up 500 Pixels 
    await scroll(0,-500)
    
    // Scroll Up 500 Pixels 
    await scroll.vertical(-500)
    
    // Scroll Left 500 Pixels 
    await scroll(-500,0)
    
    // Scroll Left 500 Pixels 
    await scroll.horizontal(-500)

    // Scroll Down 500 Pixels, Scroll Right 500 Pixels 
    await scroll(500,500)



        
}

Last updated