I.goTo

Navigate to a URL.

You can use an absolute URL like http://mystore.com/shoes or a relative URL like /shoes.

If there is Basic HTTP Authentication on the page, add the username and password to your url like this:
https://username:password@mystore.com

Usage

I.goTo(url)
Parameter Type Remarks
url string URL to navigate to

# Absolute URL

I.goTo("https://mystore.com/shoes");

Go to https://mystore.com/shoes.

# Absolute URL with Basic HTTP Authentication

I.goTo("https://admin:psswrd123@mystore.com/shoes");

Go to https://mystore.com/shoes and login as the user admin using the password psswrd123.

# Path

I.goTo("/shoes");

Go to the "/shoes" path of the current domain.

The following table shows where the browser will be navigated to depending on the current URL:

Before After
https://example.com https://example.com/shoes
https://example.com/wallet https://example.com/shoes

# Query string

I.goTo("?color=blue")

Set the query string of the URL to 'color=blue'.

The following table shows where the browser will be navigated to depending on the current URL:

Before After
https://example.com/shoes https://example.com/shoes?color=blue
https://example.com/shoes?color=red https://example.com/shoes?color=blue

# Hash

I.goTo("#sale")

Set the hash of the url to 'sale'.

The following table shows where the browser will be navigated to depending on the current URL:

Before After
https://example.com/shoes https://example.com/shoes#sale
https://example.com/shoes#new https://example.com/shoes#sale