Sir Keir Starmer is urging ministers to put children “at the front of the queue” for coronavirus tests.
The Labour leader warned of a “flood” of school closures unless pupils were able to get the tests they needed.
His call came amid reports that 350 schools in England and Wales were forced to close completely or to send children home last week following positive Covid-19 tests.
Sir Keir said it was essential that children whose schooling was disrupted by the lockdown did not lose out even more because a shortage of tests meant they were unable to return to the classroom.
“If the prime minister does not get a grip of the testing crisis, children will be robbed of an education. We are seeing a growing flood of schools closures,” he said.
“The testing regime is not working, nor does it appreciate the unique challenges many families are having to cope with."
Sir Keir wanted the PM to give parents a "cast iron guarantee" that they can get their child a test within 24 hours and the result back 24 hours later.
He said if were prime minister, he would apologise for testing being “all over the place” and "near collapse."
He told Sky News' Sophy Ridge: “I don’t think a national lockdown is inevitable, I think it’s more likely because testing is all over the place.
“But I’ve said to the prime minister you need to take swift action, decisive action. The infection rate is clearly going up.
“The testing regime is all over the place and I think one of the concerns I have, and a lot of people have, is that because the government’s now effectively lost control of testing, it doesn’t necessarily know where the virus is.
“So if I was the prime minister, I would apologise for the fact that testing is all over the place and instead of using the summer to prepare for the autumn, which is what we said should happen, we’re in this position just when we need testing to be at its very best, it’s near collapse.”
But he said he supports the government’s move towards fining those who do not comply with self-isolation requirements.
The Labour leader was asked by Sky News’ Sophy Ridge whether he believes the creation of a legal duty for people to self-isolate was a sensible policy.
He said: “Look, I support that. There are a few people that are breaking the rules and something has to be done about that.
“I have to say that I think that is not going to be the silver bullet, that isn’t going to deal with the problem we’re in."
His comments came at the start of Labour Connected – a four-day online event in place of the party’s annual conference, which was cancelled because of the pandemic.
Sir Keir is expected to use his keynote speech on Tuesday to set out his vision for Britain after Covid-19 and to explain how he intends to lead Labour back to power.