The soldier's will at time of testing is used (together with a random factor) to determine whether the soldier will be given psionic powers by the testing.
As a result, the same soldier will have a better chance of gaining psionic powers in testing if you first take them on missions and level them up.
Likewise, a soldier that suffers a critical hit and loses willpower will have a lower chance of gaining psionic powers in testing than they would have had before the injury.
Raw rookies and squaddies can gain psionic powers, but the chance is much lower, less than one in three, so more often than not, a testing cycles of new recruits won't find a psionic soldier.
The "new guy" (all soldiers start as squaddies) and "iron will" (promotions give more willpower) officer training projects help significantly with gaining more psionic soldiers, "wet work" can also help if you're training soldiers in the field before testing them.