Software testing is a continuous process during the software development stages to ensure quality software products. Researchers, experts and software engineers keep going on studying new techniques, methods and approaches of testing to accommodate changes in software development because of the flexible requirement along with the changing of technology. So, developers and testers need to have effective methods, tools and approaches to create a high-quality product at an efficient cost. This paper provides an effective approach for context-driven testing (CDT) in an agile software development process. CDT is a testing approach that supports the tester to choose their testing techniques and test objectives based on specific contexts. The aim of this paper is to propose an effective approach for implementing the CDT in practice, called CDTiP. Through an analysis of two case studies using an agile development process with different contexts, we validate the effectiveness of the approach in terms of test coverage, detect errors, test effort. The empirical results show that CDTiP is suitable for the agile development process that can help the tester to detect defects faster at minimum cost. The results of this method have been applied at Enclave, an ODC Software Engineering company, on real projects.