The dominant view in academic scholarship (from a theological/religious view) is that God cannot come to know something because God is omniscient. Open theism challenges the traditional account and Jehovah's Witnesses believe that God exercises selective foreknowledge, that is to say, Jehovah chooses not to know some things. One verse that is invoked to support this belief is Genesis 22:12.
Here are some thoughts on the passage given from an open perspective:
"It might be suggested, I suppose, that God really did know, but that it was
necessary, for reasons unknown, for God to put the matter this way. But,
aside from this being a strained reading, with no justification in the text
itself, one then buys an absolute form of omniscience at the price of placing
the integrity and coherence of all God's words in jeopardy: does God really
mean what is said or not?" (Terence Fretheim, The Suffering of God, page 47).
"The flow of the narrative accomplishes something in the awareness of God. He
did not know. Now he knows" (Walter Brueggemann, Genesis, page 187).
"If one presupposes that God already 'knew' the results of the test
beforehand, then the text is at least worded poorly and at most simply false"
(John Sanders, The God Who Risks, page 71).
The writer of Gen. 22:12 evidently reports that God learned something new about Abraham. That is apparently how one should read the text.
However, one can read an attempted rebuttal of open theism in What Does God Know and When Does He Know It?: The Current Controversy over Divine Foreknowledge, written by Millard J. Erickson.