We already do this with Advanced Placement tests, although it would make sense to have more granular grading, to distinguish say the top .1% from the 1% from the 10%.
The most important part of this, for it to gain mainstream credibility, is for employers to actually hire people on the strength of these qualifications, as well as their interviewing skills, demonstrated work ethic, etc. Most people are going to school to get a good job, and if online education can provide that cheaper and faster, then brick and mortar schools will lose a lot of their advantage.
The optimistic scenario: employers, entrepreneurs and teachers get together to decide what they want potential employees to know, and go about writing a test that covers that material. Then the educators write courses that cover that material. In turn, these schools might even publish their student passing rates, pointing the way to the best teaching resources and methods.
While there'd be a certain amount of teaching to the test, if the tests are written well, that's not such a bad thing - the student would ace the test by knowing the material.