It's important to realize that she's having a "flight or fight" response to the stress she's perceiving. Her mind has decided that there's something inherently dangerous in the act of taking a test, and kicks in her autonomic nervous system to react as if her perceived danger is physically dangerous.
You can help her learn to calm herself down, using that awful feeling as a cue to relax. If she takes in a nice deep breath, breathing in calm and breathing out scary feelings, even giving those feelings a color, she can calm her system down. Then, to head it off next time, really talk to her and figure out what is setting it off. What is she saying to herself? If it's something like, "If I don't finish this test I'll be in trouble," teach her to counter that statement, and that she's the boss of her mind. She gets to choose what she says to herself. So in the example above, she'd say "I have all the time I need. My teacher is proud of me." Or something like that. Just teach her to say the positive opposite of whatever is setting her off.
I do a lot of hypnotherapy for anxiety with kids, and it consists of more of the stuff above, basically giving kids the tools to be the bosses of their own minds. She doesn't have to just go along on that scary ride. If you want to ask any questions, feel free to email me at ____@____.com and I'm happy to help. It's important to head anxiety off early, since it gets a hold of a kid and is much harder to get rid of later.
Good luck!