To encourage someone to do their best on a test in English, you can say "Good luck on your exam!" or "I'm rooting for you!" or "Do your best!" or "I know you can do it!" or "Don't be nervous, you've got this!" or "Give it your all!" or "I have faith in you!" or "Believe in yourself!" or "You've got this!" or "Break a leg!" (which is an expression that means "do your best" and is used to wish someone good luck, especially in theater).