Virat Kohli and Dinesh Karthik smashed hundred and India warmed up for the Champions Trophy next week with an fine five wickets victory over Sri Lanka at Edgbaston on Saturday.
Dhoni's side looked up against it when Sri Lanka scored imposing 333 for 5 after being put into bat first.
But Virat Kohli scored 144 runs from 120 deliveries and Dinesh Karthik smashed unbeaten 106 runs from just 81 deliveries guide India to win with one over left.
At one stage India were struggled at 62 for 3 in the 13th over and then 110 for 4 in the 21st over before Kohli and Karthik start the rescue.
Kohli hitted 11 fours and three sixes, while Karthik smashed 12 fours and two sixes and with Skipper Dhoni, who scored unbeaten 18, lead India ended on 337 for 5.
India will play their 2nd warm-up match against Australia on June 4 in Cardiff before start their Champions Trophy tournament against South Africa at the same ground two days later.
Dilshan hit nine fours and one six in his 84 runs, while Perera made 82 off 94 deliveries, with three sixes.
This pair added 160 runs in 26 overs before both retired in order to allow other batsmen get some match practice.