Interface WebDriver

  • All Implemented Interfaces:
    java.io.Closeable , java.lang.AutoCloseable

    
    public interface WebDriver
     implements Closeable
                        

    WebDriver defines a concise interface to visit and interact with web pages, all actions and behaviors are optimized to mimic real people as closely as possible, such as scrolling, clicking, typing text, dragging and dropping, etc.

    The methods in this interface fall into three categories:

    • Control of the browser itself

    • Selection of textContent and attributes of Elements

    • Interact with the webpage

    Key methods:

    • navigateTo: open a page.

    • scrollDown: scroll down on a web page to fully load the page, most modern webpages support lazy loading using ajax tech, where the page content only starts to load when it is scrolled into view.

    • pageSource: retrieve the source code of a webpage.