After over 3 years of drought and famine, God sent Elijah to confront Ahab. They met through the mediation of Ahab's personal house manager, Obadiah. Obadiah was a fellow believer... siding with Elijah, God and the prophets, even though he did work for Ahab. He had been a protector of godly men during a time of danger in the past.
Now, when Elijah met Ahab there was an exchange of blame. Ahab pointed a finger at Elijah; Elijah pointed right back at the king. The drought had certainly been called for by the prophet, but Ahab was the culprit. His idolatry was the cause of the plague. Now, the conflict between the royal family and the man of God was not over. It was only beginning. Elijah called for a great public competition between his God, Jehovah and Ahab's god, Baal. And, in the contest, he challenged the people concerning their religious "opinion" about God. He called for them to make up their mind (I Kings 18:21).
Most of us are familiar with the generalities of that fight. The test of deity was to be a miraculous raining of fire from the sky. God won.