AbstractOil and gas pipelines manufactured from API‐5L Grade X65 steel are generally subjected to cyclic loading and their internal surfaces are frequently exposed to corrosive sour fluids. Exposure of pipelines to these environments often leads to localized corrosion (pitting) and decreased fatigue life. Corrosion pits are geometrical discontinuities that may promote fatigue cracking by acting as stress raisers. In order to optimize asset inspection and repair scheduling, it is important to understand the fatigue behavior of X65 steel and in particular, the ability to predict the crack initiation from corrosion pit. To achieve this level of understanding, conducting fatigue tests in an environmental condition replicating the field environment is important. This paper presents the test protocol and results of environmental fatigue testing using bespoke laboratory apparatus to undertake in situ corrosion fatigue tests in a sour corrosive environment under uniaxial loading. The environment selected represent processes that are likely to occur at internal surfaces of oil and gas pipelines exposed to production fluids. The tests were carried out on smooth samples to obtain S‐N curve in this specific environment as well as on pre‐pitted samples. An electrochemical method is used to create corrosion pits on the samples. Also, a model is proposed to predict the crack initiation life from corrosion pit, using a local stress‐based technique, which has been validated by experimental test results. Post‐test fractography was carried out by scanning electron microscopy (SEM). The performance of our approach is demonstrated. The innovation is anticipated to encourage other workers to employ similar small‐scale tests requiring toxic and challenging test environments.