ranawaka contested the 2010 general election under the upfa from colombo district and was placed third place by obtaining 120,333 votes securing membership in the sri lanka parliament and appointed to minister of power and energy. in 2015 general election ranawaka contested under unp from colombo district. he was appointed the minister of megapolis and western development. he resigned on 18 november 2019.