WebDriver is a remote control interface that enables introspection and control of user agents (browsers). The methods in this interface fall into three categories: Control of the browser itself Selection of WebElements Debugging aids Key methods are {@link W
| 47 | * WebDriver specification</a> |
| 48 | */ |
| 49 | public interface WebDriver extends SearchContext { |
| 50 | // Navigation |
| 51 | |
| 52 | /** |
| 53 | * Load a new web page in the current browser window. This is done using an HTTP POST operation, |
| 54 | * and the method will block until the load is complete (with the default 'page load strategy'. |
| 55 | * This will follow redirects issued either by the server or as a meta-redirect from within the |
| 56 | * returned HTML. Should a meta-redirect "rest" for any duration of time, it is best to wait until |
| 57 | * this timeout is over, since should the underlying page change whilst your test is executing the |
| 58 | * results of future calls against this interface will be against the freshly loaded page. Synonym |
| 59 | * for {@link org.openqa.selenium.WebDriver.Navigation#to(String)}. |
| 60 | * |
| 61 | * <p>See <a href="https://w3c.github.io/webdriver/#navigate-to">W3C WebDriver specification</a> |
| 62 | * for more details. |
| 63 | * |
| 64 | * @param url The URL to load. Must be a fully qualified URL |
| 65 | * @see org.openqa.selenium.PageLoadStrategy |
| 66 | */ |
| 67 | void get(String url); |
| 68 | |
| 69 | /** |
| 70 | * Get a string representing the current URL that the browser is looking at. |
| 71 | * |
| 72 | * <p>See <a href="https://w3c.github.io/webdriver/#get-current-url">W3C WebDriver |
| 73 | * specification</a> for more details. |
| 74 | * |
| 75 | * @return The URL of the page currently loaded in the browser |
| 76 | */ |
| 77 | @Nullable String getCurrentUrl(); |
| 78 | |
| 79 | // General properties |
| 80 | |
| 81 | /** |
| 82 | * Get the title of the current page. |
| 83 | * |
| 84 | * <p>See <a href="https://w3c.github.io/webdriver/#get-title">W3C WebDriver specification</a> for |
| 85 | * more details. |
| 86 | * |
| 87 | * @return The title of the current page, with leading and trailing whitespace stripped, or null |
| 88 | * if one is not already set |
| 89 | */ |
| 90 | @Nullable String getTitle(); |
| 91 | |
| 92 | /** |
| 93 | * Find all elements within the current page using the given mechanism. This method is affected by |
| 94 | * the 'implicit wait' times in force at the time of execution. When implicitly waiting, this |
| 95 | * method will return as soon as there are more than 0 items in the found collection, or will |
| 96 | * return an empty list if the timeout is reached. |
| 97 | * |
| 98 | * <p>See <a href="https://w3c.github.io/webdriver/#find-elements">W3C WebDriver specification</a> |
| 99 | * for more details. |
| 100 | * |
| 101 | * @param by The locating mechanism to use |
| 102 | * @return A list of all matching {@link WebElement}s, or an empty list if nothing matches |
| 103 | * @see org.openqa.selenium.By |
| 104 | * @see org.openqa.selenium.WebDriver.Timeouts |
| 105 | */ |
| 106 | @Override |
no outgoing calls
no test coverage detected