Dr. Jamal Badawi, Professor of Religious Studies and Management at St. Mary’s University & the Vice-Chairman of the Islamic American University, states: It is true that the Qur’an repeatedly encourages us to think and reflect and explore the universe. It is true also that the first characteristic or quality of the believer stated clearly in the Qur’an (verse 3 of chapter 2) is to believe in ghaib (the Unseen), which includes information that are inaccessible to us and cannot be discovered through our own efforts. Also, the area of knowledge that are beyond our limited human intellect and power of reasoning.
the real test of faith is to accept such information as revealed by Allah Almighty to us through His Prophets and Sacred Books. It is apparently for that reason that the Prophet, peace be upon him, instructed us: “when the issue of qadar (measure or eternal law of Allah) is raised, do not proceed any further.” That is not to teach us to be dogmatic but to realize that our intellectual power is not infinite or limitless.
More specifically, the fact that Allah Almighty is the All-Knowing and All-Powerful is a simple affirmation of His Divine qualities without which He cannot be the one and only God. But that sphere of knowledge is not up to us to argue about or mix it up with another sphere that relates to our deliberate, moral choices. A human is capable of believing in Allah and obeying Him or refusing to do so, and it is that choice that we held responsible for.
As to why Allah is testing us, that is part of His Divine wisdom, and as the Qur’an puts it clearly, Allah is not to be questioned about what He does but we are.