We implemented a finite element-front tracking method (FE-FTM) to understand the drop dynamics in microfluidic applications. We investigated the effect of viscoelasticity of both drop and medium. The Oldroyd-B model was used for viscoelastic fluid, and DEVSS-G/SUPG/matrix logarithm algorithms were applied to improve numerical stability. We first verified the reliability of the algorithm by comparing with previous results under simple shear flow. The results were in good agreement with previous reports in a wide range of parameters such as capillary number (Ca) and Deborah number (De). Then we applied the algorithm to a 5:1:5 planar contraction – narrow channel – expansion flow which is typical microfluidic flows. One of the goal of this study is to explore the effect of viscoelasticity of drop and medium on drop deformation, and to propose the strategy to control the drop shape. When a Newtonian drop was suspended in a viscoelastic medium, in the narrow channel region, we observed an ‘ellipsoid-like drop’ in contrast to a ‘bullet-like drop’ which is the typical shape for the case of a Newtonian drop in Newtonian medium. When a viscoelastic drop is suspended in Newtonian medium, the extent of ‘drop swell’ to the cross-stream direction was enhanced at the exit of the narrow channel. We explained these phenomena in terms of the normal stress difference developed in the viscoelastic fluid. The present study shows that the viscoelasticity plays a significant role on drop dynamics and drop shape in particular. We expect this study will be helpful to understand the drop dynamics in microchannel flow, and provide useful information in manipulating drops in complicated geometries such as microfluidic channels.