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
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
Subscribe to our youtube channel to get new updates..!
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.
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.
Infographics on Selenium Commands: