Flows in nanofluidic systems are controlled by the hydrodynamic boundary condition (BC), involving the friction coefficient and the hydrodynamic wall position. Here we considered a liquid nanoslab confined between two walls, where we derived, from the Stokes equation and the Navier slip BC, analytical expressions for the liquid response to an oscillatory tangential motion of the walls in terms of the wall shear stress and mean fluid velocity. By fitting these expressions to molecular dynamics simulation results, we could extract both the viscoelastic friction coefficient and hydrodynamic wall position for walls with three different wettabilities, hence fully characterizing the frequency-dependent hydrodynamic boundary condition. The proposed method could be applied to a variety of liquid-solid interfaces of interest, e.g., for flows of complex fluids or fluids at a low temperature. It should also support methodological developments on the characterization of the hydrodynamic slip in general.