Validate URL

Use the I.amAt command to validate the url of the current tab.

Set the url that you want to check as the first argument. The URL should be enclosed in quotes.

This command will fail the test if the URL of the current tab does not match the expected URL.

I.amAt("") // this should pass

Validate URL parts

You can specify parts of the URL to validate instead of the full path. The I.amAt command will split and validate the URL into the followin parts:

  • Protocol, e.g,: http, https
  • Domain, e.g.: or
  • Path, e.g.: /books/mystery
  • Query String, e.g. ?search=history
  • Hash, e.g. #popular

Ignoring the protocol

If you want validate the domain but ignore the protocol, start with ://.

// this should pass for:
// ""
// ""

Validate path

If you want validate the path, but ignore the protocol and domain, start with / followed by the path.

// this should pass for:
// ""
// ""

Validate query string

Include ?param=value to validate the query string in the current URL.

// this should pass for:
// " in wonderland"
I.amAt("?search=alice in wonderland")

Validate hash

Include #hash to validate the hash in the current URL.

// this should pass for:
// ""





urlstringURL to check against
Last Updated: