Droplet-based microfluidic devices can be powered or manipulated by applying an external electric field, and the ability to precisely control the flow in such devices is essential for various engineering and biomedical applications. In this numerical study, we investigate the deformation dynamics of a viscoelastic droplet in a ratchet microchannel under the influence of an AC electric field. We employ the leaky-dielectric electrohydrodynamic model for both the immiscible fluid phases coupled with the Oldroyd-B model for the droplet fluid. The effect of geometrical parameters such as the type of ratchet and the wavenumber of the ratchets along with the flow parameters such as the electrocapillary number, Weissenberg number and the capillary number significantly affect the droplet shape dynamics and the polymer chain extension. For the parameters considered in this work, the electric force tends to stretch the droplet in the streamwise direction and enhances the droplet deformation and polymer extension. Several interesting effects arise as a result of the coupling of the periodic hydrodynamic forcing of the ratchet walls and the electric field. Specifically, an exponential rise in the polymer chain extension for higher ratchet wavenumbers is observed, along with the cross-stream migration of the droplet for higher electrocapillary numbers when it reaches the outlet of the ratchet constriction.