That could work, but you have to be sure that you have enough liquid fraction initially within the container so that all the liquid doesn't evaporate before you reach the critical temperature. Completely filling the container initially should do the trick, but you should do some calculations for various liquids of known VLE and PVT (vapor) behavior to make sure that that is the case.
You can also use the definition. Start our with vapor in a container at a fixed temperature, and increase the pressure isothermally until liquid (fog) starts to form. If it does, start again at a higher temperature. Keep increasing the temperature until liquid no longer forms no matter how high the pressure.