The Senate on Wednesday rejected an amendment to gut Obamacare without a replacement ready to go, a bill identical to a 2015 measure that passed Congress.

Senators voted 45-55 on the measure, with seven Republicans and all Democrats voting no. The Republicans voting no were Sens. Shelley Moore Capito of West Virginia, Susan Collins of Maine, Dick Heller of Nevada, John McCain of Arizona, Rob Portman of Ohio, Lamar Alexander of Tennessee and Lisa Murkowski of Alaska. Only Collins voted against the measure in 2015..

The Senate vote is part of a larger debate on how to repeal and replace Obamacare. The bill was expected to fail, as many Republican senators were uncomfortable with voting on repeal without an immediate replacement.

The bill is identical to a 2015 measure that passed Congress that would gut Obamacare's taxes and mandates but leave in place insurer regulations. The bill would have let Obamacare stay in place for two years while a replacement was crafted. Former President Barack Obama vetoed the legislation in 2015.

The Senate leadership took up the bill as part of a debate on repeal that was started in a narrow vote Tuesday.

A vote for a bill that would have repealed and replaced Obamacare immediately, the Better Care Reconciliation Act, also failed late Tuesday.

The goal of Republican Senate leaders appears to be to vote on a "skinny" repeal of only Obamacare's individual and employer mandate and medical device tax. The "skinny repeal" would serve mainly as a vehicle to start a conference with the House to iron out a new health bill.