Abraham passed ten tests in his lifetime. But why did G‑d need to test him? Doesn’t G‑d know what is in a man’s heart?

But when G‑d challenges you, the challenge itself lifts you higher, much higher, to a place you could never reach on your own. It reveals entirely hidden capacities, granting you access to powers you never imagined you had. 

When G‑d throws you a challenge, don’t say, “I cannot pass this test. It’s beyond me.” It may be true that you were never capable. But thanks to this challenge, now you are.

Maamar V’Avraham Zaken 5737, 4-5