Enrol a Test user to your course as you would any other user. See the first question in this FAQ. A Test user must supply the Access key for test users before he can access the course.
The Access key for test users is set in the course Settings page.
(If it is not set, Test users will be denied access to the course.)
Note: Test users cannot enrol themselves to any course.

To test a course before it is available to students, or any item while it is hidden, assign the Additional role of X-ray eyes to the Test user.