A water-injected liquid lens is fabricated to tune its focal length using the change of water salinity. It is found that when the salinity of water is changed from zero to 34.25%, the focal length can be changed by about 12.6 mm from 73.7 mm to 86.3 mm. A focal length resolution of approximately 0.75×10-2 mm and a high temporal stability over a long period have been achieved for the lens foci. This lens is then used to modify the z-scan technique where the lens and the sample are both remained fixed without displacement. The performance of the fabricated lens is evaluated by nonlinear refractive index measurement of a sample containing 10.82-pH-syntesized Silver nanoparticles (AgNPs) suspended in water with 15 mM of concentration. For verification of the results, nonlinear refraction index of (-10.6±1.0)×10-7 cm2/W is firstly measured for the sample using a classical z-scan benefiting from conventional focal-fixed lens. Interestingly, we found out that when the fabricated lens if replaced in the modified z-scan, the nonlinear refraction index of about (-8.1±0.2)×10-7 cm2/W can be measured, indicating a similarity in the order and small difference in the coefficient compared to the classical z-scan. This outcome highlights the potential capability and simplicity of the fabricated lens in the modification of classical z-scan technique.