The royals are casting a spell on London! Kate Middleton, Prince William and Prince Harry got a tour of Warner Bros. Studios on Apr. 26, where the royal trio checked out the Harry Potter and Batman exhibits.

Middleton, 31, dressed her growing baby bump in a polka dot Topshop dress and a Ralph Lauren blazer for the occasion. Joined by her husband and brother-in-law (both wearing suits), the six-months-pregnant Duchess of Cambridge attended that event with more than 500 children and their parents.

PHOTOS: How Kate Middleton is getting ready to be a mom

The famous Brits were shown the set of the Gryffindor Common Room in Hogwarts, used by Harry Potter and his friends in the blockbuster films. The parents-to-be were given a few simple "spell techniques" by tour instructor Scott Heron before being asked to face a group of children called "Dumbledore's Army." Harry, meanwhile, was busy looking around The Burrow, home of the Weasleys.

William, 30, gamely aimed his wand and shouted, "Expelliarmus!" (In author J.K. Rowling's book series and its eight film adaptations, "expelliarmus" is a frequently used disarming charm.) The second in line for the throne then told the crowd, "I haven't read the books, but I have seen all the films." Middleton, meanwhile, is an avid reader. "The films are good an the books are great, aren't they?" she asked several children.

PHOTOS: Royal pregnancies

Heron was impressed with the royal couple's wand abilities. "They were great. They picked it up really quickly," he said. "I was very impressed." The couple were then taken to the set of Diagon Alley, where wizards  buy their wands and school textbooks. Harry, 28, met up with his brother and sister-in-law on the cobbled streets.

The three were each given a wand that lit up in a different way. "It's not fair," Harry said. "They've had a lesson!" The Brits were then instructed to point their wands at a sign in the shape of a cauldron and press a button hidden in the base of their props to make it explode. Though William and his wife executed the move with ease, Harry's wand failed to function. "It's always the wizard, never the wand," laughed his instructor, 27-year-old Lauren Coates.

PHOTOS: Kate Middleton's growing baby bump

Before they moved on to the next exhibit, the three royals were given hand-carved wands of their own. Ever the troublemaker, Harry immediately challenged his older brother to a duel. During their visit, the group also met with local dignitaries and senior executives from the film studio.

In addition to visiting the Harry Potter set, the group scoped out vehicles from the Dark Knight franchise. William joked about taking over the Batman role with Josh Berger, president and managing director of Warner Brothers UK, Ireland and Spain. "Christian Bale's getting old and tired," the prince joked. "I will stand in if I have to." (The final film in director Christopher Nolan's trilogy premiered in July 2012; Bale has no plans to reprise his role as the DC Comics hero.)

When William spotted the Batmobile, he nudged his younger brother and joked, "We should borrow that for the weekend." Once he climbed inside, William said he was a "very happy man" -- until Middleton caught his eye. "Sorry, sorry," her husband said.

"I'm over the moon just to have seen the real Batmobile and Batpod. You don't have baby seats for those cars, do you, by any chance?" William joked. "On the other hand Harry's just excited to see a real-life talking owl in the Harry Potter studios. I haven't told him yet that Harry Potter is fictional, so please keep the secret for a little longer."

This article originally appeared on Kate Middleton, Prince William and Prince Harry Tour Warner Bros. Studios