Kirstjen M. Nielsen, the nominee to be the next homeland security secretary, testifies before the Senate Homeland Security and Governmental Affairs Committee on Nov. 8. (Win McNamee/Getty Images)

President Trump’s nominee to lead the Department of Homeland Security cruised through her Senate confirmation hearing Wednesday, easily fielding questions on an array of security issues while making no stumbles or gaffes.

Kirstjen M. Nielsen, 45, the White House deputy chief of staff, was challenged on several topics by Democratic members of the Committee on Homeland Security and Governmental Affairs, but her hearing produced no controversies that might jeopardize a swift confirmation.

Handpicked for the job by John F. Kelly, Trump’s chief of staff, Nielsen would be the first DHS secretary with previous experience working at the agency, a bureaucratic behemoth of 240,000 employees and a $40 billion annual budget.

Her familiarity with DHS’s 22 sub-agencies, which include the Federal Emergency Management Agency and Customs and Border Protection, was not in doubt during the hearing, as she parried questions on airport security, extremist violence, immigration and how to stop opioids sent through the mail from China.

Asked whether she would be capable of standing up to the White House, Nielsen told lawmakers that she would not hesitate to challenge Trump if asked to do something "in violation of the law." When Sen. Jon Tester (D-Mont.) sought her views on Trump's plans for a wall along the Mexican border, Nielsen echoed Kelly's assessment, telling the panel that "there is no need for a wall from sea to shining sea."

Hard-line conservatives, including author Ann Coulter, seized on those remarks and attacked Nielsen online, but she got mostly softballs Wednesday from Republican senators, many of whom addressed her as if she were already in charge of DHS.

Sen. Kamala D. Harris ­(D-Calif.), one of the Trump administration's fiercest critics, pressed Nielsen on her plans for immigration enforcement, asking her what she would do if Congress fails to legalize the nearly 700,000 "dreamers" whose protections under the Deferred Action for Childhood Arrivals (DACA) program are set to expire next year.

Nielsen told Harris that if Congress fails to act, DACA recipients would not be an enforcement priority for Immigration and Customs Enforcement (ICE), and she said that DHS would not use dreamers’ personal information to track down and deport them.

Conservative proponents of tougher immigration policies expressed disappointment with Nielsen's response.

Some of the toughest questions Nielsen faced were from Sen. Thomas R. Carper (D-Del.), who criticized Nielsen’s lack of high-level management experience: “Why should we believe, as smart as you are, having never led an organization of more than 100 people, that you are ready to take on a responsibility this large now?”

Carper and other Democrats also bristled when Nielsen refused to say that human activity was the primary cause of climate change.

“I do think the climate is changing,” Nielsen said, but she told the panel she needed to read more scientific papers on the topic.

Nielsen would replace the acting DHS secretary, Elaine Duke, who is well-liked by DHS staffers but whose résumé is short on counterterrorism or law enforcement credentials. Trump has said he wants Duke to remain at DHS as Nielsen’s deputy.

Nielsen served as Kelly’s chief of staff when he was DHS secretary from January to July. Her nomination was viewed as further evidence of the former Marine Corps general’s effort to bring a more disciplined, conventional management approach to the administration.

Kelly made Nielsen his deputy at the White House, where some staffers grumbled about her personality and viewed her as a stern enforcer.

In introducing Nielsen as his DHS pick last month, Trump praised her “sterling reputation” as a seasoned public servant dedicated to national security, “not politics or ideology.”

Nielsen, an attorney and cybersecurity expert, started her career crafting legislation and policy at the Transportation Security Administration, then served as a White House adviser for emergency preparedness and disaster management under President George W. Bush.

Nielsen had that job when Hurricane Katrina hit in 2005, and she told the panel that she had gained crucial insights into emergency management from the federal government’s widely criticized response to the deadly storm, particularly the importance of having supplies and FEMA contractors in place before disaster strikes.

Committee members are expected to vote Thursday on her nomination, and the White House is pushing for a full Senate vote as soon as possible.