Blog

GoBack, Refresh, MouseOver and Highlight commands - SELENIUM

  • (4.0)
  •   |   619 Ratings

Selenium Commands

Go Back

If user clicks Back button of the Browser, then we need to use below command
Syntax:-
goBack()
Simulates the user clicking the “back” button on their browser

Interested in mastering Selenium Training? Enroll now for FREE demo on Selenium Training Course.

Refresh

If the user wants to press the refresh key or button in browser.
Syntax:
         refresh()
Simulates the user clicking the “Refresh” button on their browser.

Related Page: Automation Selenium RC Using TestNG - Selenium

Enter key simulation

If user press Enter button from key board, then we need to use below command.
Syntax:-
      keyPress(locator, keySequence)
Arguments:

  • locator - an element locator
  • keySequence - Either be a string(“” followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: “w”, “119”.
  • Simulates a user pressing and releasing a key.

Checkout Selenium Interview Questions

MouseOver

If a user hover the mouse on an element
Syntax:
     mouseOver(locator)
Arguments:

  • locator - an element locator
  • Simulates a user hovering a mouse over the specified element.

Checkout Selenium Tutorial

Highlight

If you want to execute specific step
Syntax:
     highlight(locator)
Arguments:
locator - an element locator

Briefly changes the background Color of the specified element yellow. Useful for debugging.

  • Find
  • Find is a button in selenium IDE. Which is used to find the element.
Explore Selenium Sample Resumes! Download & Edit, Get Noticed by Top Employers!Download Now!

 

Infographics on Selenium Commands:

 Selenium Commands

 

 


Popular Courses in 2018

Get Updates on Tech posts, Interview & Certification questions and training schedules