Java – is webdriver a class or an interface?

Starting with selenium docs, webdriver is an interface, but in eclipse, org openqa. Selenium packages are displayed in Project Explorer as class In addition, if webdriver is an interface, the classes such as chrome driver or Internet Explorer driver that implement it should be defined Get() or Getcurrenturl(), etc Where can we see the method definitions of these methods?

Solution

Webdriver is a public interface. I don't think chrome driver or any other driver implements webdriver, but extends remotewebdriver, which is a class

edit

As I said, the driver extends remotewebdriver and has a practical implementation of these methods

public void get(String url) {
   execute(DriverCommand.GET,ImmutableMap.of("url",url));
}

Java source:

public interface WebDriver extends SearchContext {
  // Navigation

  /**
   * Load a new web page in the current browser window. This is done using an HTTP GET operation,* and the method will block until the load is complete. This will follow redirects issued either
   * by the server or as a Meta-redirect from within the returned HTML. Should a Meta-redirect
   * "rest" for any duration of time,it is best to wait until this timeout is over,since should
   * the underlying page change whilst your test is executing the results of future calls against
   * this interface will be against the freshly loaded page. Synonym for
   * {@link org.openqa.selenium.WebDriver.Navigation#to(String)}.
   *
   * @param url The URL to load. It is best to use a fully qualified URL
   */
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>