Many had already texted their parents to say how scared they were when the alarm sounded at Craigie High School, Dundee (on Mon 4 Dec).
Dundee City Council said it was important that drills were as realistic as possible.
“As soon as the procedures had been tested, the school community was informed that it was an exercise,” said a spokesperson.
But parents complained that pupils should have been warned.
Ryan Hurrell, 37, said his son sent him a message to tell him to the school was “on lockdown” just after midday.
He was about to make his way down to the school as he feared for his son’s safety.
He said: “My son said there were three bells and then a prolonged bell that rang. The kids went into a common room and were told to get under the tables — then my son texted me to say the school was on lockdown.
“I made attempts to try to call him after that message was sent and he sent me a text about 12.41pm to advise it was a drill. He said that there were a few girls who looked terrified at what was happening.
“I realise this is unfortunately a sign of the times of the world we live in and the school needs to carry out these procedures. But there should have been some communication prior to the event.”
Kevin Keenan, leader of the Labour group on the council, said he felt parents should have been told about the drill.
He said: “I’ve never come across an exercise like that in my life, either as a councillor or parent.
“While I understand these scenarios have to be as real-life as possible, I think parents should have been given prior warning.
“It could have been very traumatic for the children and parents involved, regardless of how long it lasted. I’ll certainly question council officers as to why there was no warning for parents.”
A spokesman for Dundee City Council said: “In common with other schools across the city, Craigie High School periodically tests the resilience of its procedures.
“Clearly it is important that any drill is as realistic as possible, but as soon as the procedures had been tested, the school community was informed that it was an exercise.”