Has any one had a problem with their engine shutting down? on 2006 Toyota Tacoma

I would be driving and sometimes the truck would hesitate and shuts down,my mechanic installed a new fuel pump thinking that would take care of the problem but it didn't? If anyone had a similar encounter like this please let me know what i need to do,since the dealer can't figure it out.

Asked by for the 2006 Toyota Tacoma
Intermittent faults are very tough to resolve. But the only way to really find out what is wrong is to catch it in the act and find out what element is missing when the stall occurs. Fuel? Spark? Air? Exhaust? Once you have a direction, things get a little more clear. Good luck.
1 more answer
Having problems starting for the past two months. New battery and by the time it gets tested it starts again, not able to do diagnostic tests until it won't start. When they do test, nothing comes up because it starts. Tried spare keys, changed fuel relay and flushed system.