Why does the engine hesitate then shut down when no DTC codes are present? on 2006 Toyota Tacoma

there is no code present,but after driving for a while the truck would hesitate then it would just shut down. It does'nt happen all the time.When it stops You would have to let it cool down and then it would start.Toyota said they could not find the problem.I've already replaced the fuel pump with a new one but the problem is still there.

Asked by for the 2006 Toyota Tacoma
Not all concerns will trigger DTC's. When the problem occurs, you need to basically test for fuel and spark - see what is missing, and pursue that area.
There is spark but no fuel,installed a new relay but that didn't help. Any other suggestions?
If there is no fuel, you need to check for power to the fuel pump. If the fuel pump is getting power, and there is no pressure - then obviously there is a pump issue (even a new one).

If there is no power getting to the pump, you have to think backwards to see what needs to be present to provide power to the pump. Here's where a wiring diagram and shop manual help out a ton.

This is not a conventional problem, and should be pretty obvious to figure out -- usually things are not terribly complicated.
I'm getting power to the fuel pump relay but it doesn't complete the circuit for the relay to close, which have me thinking that the ground for the relay isn't working. I'm trying to get the electrical schematic for the truck in order to trace the wires. Is the computer responsible for grounding the fuel pump relay or not? Thanks
There is a fuel pump resistor behind the left front headlight. This could be a source of issue as well.

It appears that the processor grounds the pump, and then in turn grounds the relay.