Editor's note: Julian Zelizer is a professor of history and public affairs at Princeton University. He is the author of "Jimmy Carter" and of the new book "Governing America."
(CNN) -- The hurricane that is blowing through the East Coast has threatened to create the kind of unpredictable havoc in this election that presidential candidates always fear. With all the scripted television spots and carefully choreographed live appearances, Hurricane Sandy is generating fear that might push the campaign in directions that nobody has expected.
Mitt Romney and President Barack Obama, and their circles of advisers, are likely glued to the weather coverage, trying to figure out which way this hurricane will make the election winds blow.
Social scientists have studied the impact of extreme weather on elections in American history, such as the ways in which Hurricane Andrew in Florida affected the 1992 contest between President George H.W. Bush and Bill Clinton
But the severity of the unfolding hurricane, which will stretch across several states if the worst predictions come true, might be more dramatic than anything we have seen in a long time. The hurricane will pose a huge test for Obama in the next few days, one that will make the debate in Denver look like child's play.
As voters, particularly those who are undecided, deliberate over whom they should support, they will watch Obama as he navigates through the storm and the post-storm clean-up. The crisis offers an opportunity for him to act presidential in a way for which some voters are thirsting and to demonstrate the kind of command that has often been lacking.
He does not want to be an echo to President George W. Bush's response to Hurricane Katrina, which became a symbol of incompetence.
At the same time, there is little that Mitt Romney can do, other than watch to see what people think of Obama's response, because any statement from him could easily become seen as political and offer little evidence of his own ability to lead.
The storm has already forced the campaigns to alter their short-term strategies. Already, both campaigns have canceled events in key states such as Virginia that are in the eye of the storm.
Romney will certainly have to pull some of the television spots that he has been getting ready to unleash in the final days of the campaign. Romney's strategy has focused on saving for a last-minute advertising blitz for which he planned to unload his campaign's coffers. Republicans didn't count on a storm getting in the way.
As Americans watch to see their fellow countrymen and women struggling through a crisis, they won't want to be bombarded with 30-second attack ads.
The Romney campaign will have to quickly think of ways to redesign their ads in certain states so that they fit the moment and provide voters with hope about new leadership rather than take the risk of generating criticism of the GOP being too petty and political, as occurred with Libya. Romney's team will have to redirect some of their energy toward states not affected, leaving the airwaves silent in the other states, waiting to see whether Romney has the momentum that can carry him.
There is also the effect Sandy will have on the media, which already has focused primarily on the weather and much less on the presidential campaign. This gives candidates less space and time to influence events. Ordinarily, this would be a valuable time, a period when campaigns have one last week to shape voters' preferences, but this will become extraordinary difficult.
If electric power fails and people become preoccupied with personal hardships, there will be less time to focus on politics and it's possible that voter perceptions might be frozen into place.
Finally there is the big question of voting behavior. How will severe weather affect voters in states such as Virginia?
Many observers expect that this could depress voting in lower-income areas, which are often badly affected and which have the least resources to recover, a development which would naturally hurt Democrats. It also has caused cancellations in early voting that might have benefited Obama's vote total.
Another unpredictable factor is the sheer anger and frustration that can come from a weather crisis like this, which might very well intensify the broader sense of malaise that exists in the electorate. Even to those who are not in the path of the hurricane, this could feel like one more punch in the face to a nation tired of waiting for real economic recovery.
We can hope the most dire predictions about Hurricane Sandy will be wrong. But if they are not, the presidential candidates will face a massive test. Both candidates will need to scramble to make sure they handle it well.
The opinions expressed in this commentary are solely those of Julian Zelizer.