  By analyzing two sets of complete $BVR_cI_c$ light curves of V342 UMa and
three sets of complete $BVR_cI_c$ light curves of V509 Cam, we determined that
the two systems are both W-subtype contact binaries and that V342 UMa shows a
shallow contact configuration, while V509 Cam exhibits a medium contact
configuration. Since both of them are totally eclipsing binaries, the physical
parameters derived only by the photometric light curves are reliable.Meanwhile,
the period changes of the two targets were analyzed based on all available
eclipsing times. We discovered that V342 UMa shows long-term period decrease
with a rate of $-1.02(\pm0.54)\times10^{-7}$ days/year and that V509 Cam
exhibits long-term period increase with a rate of $3.96(\pm0.90)\times10^{-8}$
days/year. Both the conservative mass transfer and AML via magnetic stellar
winds can interpret the long-term period decrease of V342 UMa. The long-term
period increase of V509 Cam can be explained by mass transfer from the less
massive star to the more massive one. The absolute parameters of the two
binaries were estimated according to the Gaia distances and our derived
photometric solution results. This method can be extended to other contact
binaries without radial velocities but with reliable photometric solutions. The
evolutionary states of them were discussed, we found that they reveal identical
properties of other W-subtype contact systems.
