The instances of God asking Adam "where are you?"(Gen 3:9), or this instance of testing men to know what is in their heart reveals the anthropomorphic literary tool to communicate the divine in our human language. God has even been depicted as regretting for creating man (Gen 6:7), or having human emotions and body parts, it doesn't mean he really regrets or have human emotions, but it only conveys his intention or will on our level. It is only a way of communication for our purpose to reveal the divine, it is not a contradiction with his divine attributes.
Anthropomorphism in the International Standard Bible Encyclopaedia:
- Definition of the Term:
By this term is meant, conformably with its etymological
signification, i.e. as being in the form or likeness of man, the
attribution to God of human form, parts or passions, and the taking of
Scripture passages which speak of God as having hands, or eyes, or
ears, in a literal sense. This anthropomorphic procedure called forth
Divine rebuke so early as Ps 50:21: "Thou thoughtest that I was
altogether such a one as thyself."
- Old Testament Anthropomorphisms:
Fear of the charge of anthropomorphism has had a strangely deterrent
effect upon many minds, but very needlessly so. Even that rich
storehouse of apparently crude anthropomorphisms, the Old Testament,
when it ascribes to Deity physical characters, mental and moral
attributes, like those of man, merely means to make the Divine nature
and operations intelligible, not to transfer to Him the defects and
limitations of human character and life.
- In What Senses an Anthropomorphic Element Is Necessity:
In all really theistic forms of religion, there is an anthropomorphic
element present, for they all presuppose the psychological truth of a
certain essential likeness between God and man. Nor, perfect as we may
our theistic idea or conception of Deity, can we, in the realm of
spirit, ever wholly eliminate the anthropomorphic element involved in
this assumption, without which religion itself were not. It is of the
essence of the religious consciousness to recognize the analogy
subsisting between God's relations to man, and man's relations to his
fellow. We are warned off from speaking of "the Divine will" or "the
Divine purpose," as too anthropomorphic-savoring too much of simple
humanity and human psychology-and are bidden speak only of "the Divine
immanence" or "the Divine ground of our being."
God sends trials and tribulation to test and refines the believers to perseverance and endurance.
[ESV Jamess 1:2-4]
2Count it all joy, my brothers, when you meet trials of various kinds, 3for you know that the testing of your faith produces steadfastness. 4And let steadfastness have its full effect, that you may be perfect and complete, lacking in nothing.
[ESV Romans 5:3-4]
3Not only that, but we rejoice in our sufferings, knowing that suffering produces endurance, 4and endurance produces character, and character produces hope,