Houston I have a problem

Navigation Step Commands

Follow

The StillAlive Script Editor has many types of steps that you can use to navigate, perform actions and check things on your website.

The commands are broken down into three main categories:

  • navigation
  • action
  • validation

This article explains the different type of Navigation Commands you can use to get StillAlive started on your website.

There are two navigation steps;


When I go to URL( expecting a STATUS response)

This is the most common way to start your script. This tells StillAlive to navigate it's browser to the URL you provide.

The URL needs to be a complete URL, such as http://www.example.com/. Giving StillAlive just a path such as /my/homepage won't work because StillAlive won't know where to begin.

StillAlive can handle both standard HTTP URL or a secure https URL. For example you can do:

When I go to http://www.example.com/

or:

When I go to https://www.example.com/

Additionally, StillAlive can check the HTTP response code of your page to make sure your website is performing correctly. This is useful to check that a protected page is unavailable, for example:

When I go to http://www.example.com/ expecting a 404 response
Then I should see "You are unauthorised to view that page"

Another use of this is to make sure your old website redirects to your new website:

When I go to http://old.example.net/ expecting a 301 response
Then I should be on http://new.example.com/
Then I should see "Welcome to our website"

When I login via basic auth with "USERNAME" and "PASSWORD"

Some websites are protected from access via HTTP Basic Authentication, this requests a username and password from the browser before the website will even be shown. If your website has this, then you can supply the username and password first using this step before navigating to the website.

For example:

When I login via basic auth with "user" and "mypassword" 
And I go to https://secret.example.com/
Then I should see "Welcome to our website"

Once you have navigated to your website, you then should either validated something or perform an action. You can find out more about these on our help pages for Action Steps or Validation Steps.

Note, you don't want to test for a response code like "200" because of the way the Script runs. If you wanted to confirm that HTTP Basic Auth was running (without logging in) you could do something like:

When I login via basic auth with "user" and "mypassword" 
And I go to https://secret.example.com/ expecting a 401 response 
Then I should not see "Welcome to our website"

This will confirm that authentication failed.

Was this article helpful?
0 out of 0 found this helpful

Comments