You can buy the book Get Your Captains License. There is a disk with it that has all the questions from the test. The book and disk is about $60.
When you install and run the disk, it will give you questions at random in a mix similar to what you would get if you took it with USCG. It grades you and tells you if you pass.
There are places on line to get a copy of all the possible questions.
You can bone up independently and then take the test at the nearest REC (regional exam center) all of which are listed on the USCG web site (
USCG Licensing & Documentation). There is also a list of all approved course. If there is an online approved course, it will be listed there. I seriously doubt you can take the test on line. It must be monitored.
There are some good on line courses on rules of the road (
Online Tests Boatingsafety.com).
When I did my OUPV I did it at a local community college. Tuition was $60. Check with schools in your area. Not knowing where you are, I can't help you there.
There are options to the high priced guys.
George