w3c-webdriver
  • Introduction
  • Capabilities
  • Sessions
  • Timeouts
  • Navigation
  • Contexts
  • Elements
  • Document
  • Cookies
  • Actions
  • User prompts
  • Screen capture
  • Examples
    • Cucumber Functional Tests
  • Resources
    • GitHub
    • WebDriver spec
    • MDN docs
Powered by GitBook
On this page
  • session.navigateTo(targetUrl)
  • session.getCurrentUrl()
  • session.back()
  • session.forward()
  • session.refresh()
  • session.getTitle()

Was this helpful?

Navigation

PreviousTimeoutsNextContexts

Last updated 3 years ago

Was this helpful?

session.navigateTo(targetUrl)

Navigate to a new URL.

PARAMETERS

  • targetUrl: string - New URL to navigate

RETURNS

Promise<void>

EXAMPLES

await session.navigateTo('http://localhost:8080');

SEE ALSO

session.getCurrentUrl()

Get current page URL

RETURNS

Promise<string>

EXAMPLES

const currentUrl = await session.getCurrentUrl();
// currentUrl = 'http://localhost:8080'

SEE ALSO

session.back()

Navigate to previous url from history

RETURNS

Promise<void>

EXAMPLES

await session.back();

SEE ALSO

session.forward()

Navigate forward to next url from history

RETURNS

Promise<void>

EXAMPLES

await session.forward();

SEE ALSO

session.refresh()

Refresh the current page

RETURNS

Promise<void>

EXAMPLES

await session.refresh();

SEE ALSO

session.getTitle()

Get the current page title.

RETURNS

Promise<string>

EXAMPLES

const title = await session.getTitle();
// title = 'web page title'

SEE ALSO

WebDriver spec
WebDriver spec
WebDriver spec
WebDriver spec
WebDriver spec
WebDriver spec