Can you measure the voltage of a capacitor with using an oscilloscope without a function generator?
You can, and you did.
Largely this was possible because you used storage scope.
If you had only an analog scope available, then to keep an image on the screen you would have likely needed to repeat the same experiment over and over, alternately charging and discharging the capacitor using a square wave source.
You also appear to have chosen a small enough resistor that the RC time constant was brief enough to accomplish a full charge during the first tentative contact you (manually?) made.  It's quite possible that first tentative contact did not last but rather &quot;bounced&quot; however your scope sweep is so fast that your entire charging process may have occurred between the first tentative contact and any temporary disconnect, as there seems to be no &quot;hesitation&quot; in the charging curve.
And you selected a trigger which well captured the event of interest.