how to get infill on self created stl via onshapes
I don't use either of the two piece of software, but the first things to pop to mind:


Inspect the slicing preview: it should be self-evident if your GCODE is being generated correctly.  In my slicer the infill is red and you can discern the typical pattern within:





Check your settings: your shell thickness should be something reasonable (like 0.8mm / 2 shells) and your infill should also be below 100% if you don't want to print it solid.  For maximum strength, it doesn't help go much over 60%, typical values for light-duty parts are 20% and 30%.
Check your STL file: your mesh should be a closed surface, a "shell". Or the slicer won't be able to know what is "inside" and "outside".  Many slicers verify this for you automatically and have a built-in utility to attempt to "repair" a broken mesh.  I use slic3r Prusa Edition and this information is visualised at the bottom right:





Let the print finish: the wording of your question is ambiguous, but it sounds like you may have stopped the printer before the part finished.  Certain combination of settings can be deceitful.  For example, a layer height of 0.05mm and a shell thickness of 2mm means you will see the printer making 40 (forty!) layers of solid printing, before starting to create the infill.
Try another slicer: in case your slicer went berserk because of a bug (unlikely but possible), this should fix it.


On an unrelated note: the use of infill has a lot of different reasons besides "saving filament", for example:


relative to an empty print, even a very light infill (5%) provides a lot of added rigidity,
relative to a solid print, infill reduces weight and relief the tensions that are trapped in the FDM/FFF printing process
certain infill patterns allow to provide different responses to stressed in different directions (like for example a crash box that needs to give way in one direction but bear a load in another, or a wing that need to flex on its length but not on its chord)
infill provide support for top layers and other concave structures that may otherwise be non-printable
...