Author - StudySection Post Views - 35 views
Selenium

WebDriver Commands Used in Selenium

Basic Selenium Commands:

  • Open a URL
    • Get Method: The driver.get() method is used to navigate the web page by passing the string URL as a parameter.
    • Navigate Method: The driver. navigation().to() does the task of opening the Webpage like the driver.get() method.
  • Fetching text written over any web element
    • We have a getText() method in the selenium web driver.
  • Navigate Background in a Browser
    • It provides the navigation().back() command to move backward in the browsers.
  • Navigate Forward in a Browser’
    • It provides the navigation().forward() command to move forward in the browser.
  • Refreshing the Browser
    There are multiple ways to refresh the browser in the Selenium WebDriver as follows:-
    driver.get(“URL”) command with the current URL
    driver().navigate().to(“URL”) command with current URL
    driver().navigate().refresh() Command
    SendKeys(Keys.F5)on any text on the webpage
  • Clicking on WebElements
    The Click() method in selenium is used to perform the click operation on web elements.
    The Click() method is applied to the web elements Identified, to perform the click operation.
  • Writing in a Textbox
    The send key() method can be used to write in a textbox or any element of input text types.
  • Clearing text in a Textbox
    The clear() method is used to clear the text written in the textbox or any text input type web element.
  • Closing Browser
    Selenium provides two commands to close the browser: close() and quit().
    driver.close() used to close the browser.
    driver. quit() used to close all the browser instances open.

If you need to prove your skills in the .NET framework, get .NET certified on StudySection. StudySection provides .NET certification exam for beginners as well as experts in the .NET framework. This .NET certification can improve your resume’s success rate.

Leave a Reply

Your email address will not be published.