The parliament building is about 5 miles from downtown Colombo, in the suburb of Sri Kotte, well inside the urban area limits of Colombo. Sri Lanka's government website names Colombo as the capital, as does Britannica, Lonely Planet, Free Dictionary and the University of Colombo. The CIA Factbook and Wikipedia have a dollar each way on this, naming both Colombo and Sri Jayawardenepura Kotte as capitals - as do we, because SJK also gets a mention in quizzes referencing capitals containing S, J, K and so forth.
Not only is Colombo not the capital of Sri Lanka(the legislative capital is Sri Jayawardenapura Kotte) but Cotonou is NOT the recognized capital of Benin. That's Porto Novo. Cotonou has the government seat and is the largest city, but it is not the official capital.
There will always be debates like this for as long as there are multiple cities in countries carrying out the function of governing. There's a similar example with The Hague, where the Dutch parliament sits, and Amsterdam. As for Colombo (where I have spent time, so I modestly claim to know what I'm talking about there), see above. I've not been to Benin so cannot make a definitive call on that one, so for now we're happy to go with Benin's capitals as they appear in the World Capitals quiz, which lists both.