The brothers of Yosef had sold him into slavery because of their jealousy, and because Yosef had dreamt that his brothers, mother, and father would one day bow in respect to him.
5 Then Yosef had a dream, and when he told it to his brothers, they hated him even more. . . .8 So they hated him even more for his dreams and for his words. . . 19 They said to one another, "Here comes the dreamer! 20 Now then, come let us kill him . . . ."
Years later in Egypt during the famine, Yosef was now testing his brothers to determine if they would, in turn, accuse Benyamin of the same "sin" of divination. The contents of the cup of divination, when drunk, would provide the stupor or hallucinatory effect for dreaming and seeing visions. (Centuries later the correlation of intoxication with wine and seeing visions appears in Isaiah 28:7.) Would the brothers hate innocent Benyamin "the dreamer" in the same way that they had hated Yosef "the dreamer"? The brothers once sold Yosef into slavery for silver; now Yosef was testing them with the same silver to determine if they would also betray their brother Benyamin. The Jewish scholar Nahum Sarna wrote the following in this regard:
. . . The fact that we are told it [the cup of divination] is made of silver is not meant solely to emphasize its preciousness; the offense would be grave enough no matter what the composition of the goblet might have been. The main point here is that Hebrew kesef, “silver, money,” is a key word, reiterated twenty times in the accounts of Joseph and his brothers in Egypt (chaps. 42–45). The brothers had sold Joseph into slavery for twenty pieces of silver (Gen. 37:28); now he harasses and tests them with silver. (emphasis added)
The test backfired when Yosef discovered that his brothers had deep compassion for Benyamin, for whom they were willing to sacrifice themselves. In this regard, the brothers then considered that their current crisis was punishment for what they had done years earlier to Yosef, whom they had believed was long dead (Gen 44:20).
Yosef had also noted earlier that the brothers did not react in jealousy to Benyamin, when Yosef had served five extra portions of food to Benyamin at the same table with his brothers (Gen 43:34).
In light of these observations, the "cup of divination" was a ploy by Yosef, and therefore Yosef did not practice divination. In fact, his faithfulness during his 23 years of separation from his family of birth stemmed from his faith that his dreams had come direct from the Lord (who also provided to Yosef the dream interpretation for Pharaoh), and therefore were destined for complete fulfillment.
Sarna, Nahum M. (1989). Genesis. Philadelphia: Jewish Publication Society, 303.