The conjuctions while and whereas mean nearly the same thing when used to contrast one thing to another thing.
In test A, a weak magnet was used, whereas/while in test B, a strong magnet was used.
Note that the word whereas cannot be used as a substitute for while if while indicates that two or more things are happening at the same time.
Test A was performed while test B was still being designed. (Test A happened before I finished designing test B.)