There are various ways to divine the future in a fairy tale: dreams can reveal an answer to a question, signs or auguries can be interpreted or a medium can be consulted to communicate with a ghost or spirit. An early account of communicating with a ghost is told in 1 Samuel 28. Often the person most anxious to know the future is undone by the information received. The story of Saul and the "woman of spirits" is a good example. See the link for the entire Biblical story.