Skip to content

Instantly share code, notes, and snippets.

View Suweka's full-sized avatar

Suweka Sansiluni Suweka

  • Sri Lanka
View GitHub Profile

Core WebDriver Methods

Method Description Example
driver.get(URL) Opens a webpage driver.get("https://google.com")
driver.getTitle() Returns page title String title = driver.getTitle()
driver.getCurrentUrl() Returns current URL String url = driver.getCurrentUrl()
driver.getPageSource() Returns HTML source String html = driver.getPageSource()
driver.close() Closes current window driver.close()
driver.quit() Closes all windows & ends session driver.quit()