My 1997 Nissan Altima is hesitating and dies randomly

My car keeps hesitating and dies. Doesnt do it all the time. I took it to 2 different shops and had diagnostics with no results…only thing found was a bad battery cable but it is still randomly acting up. We checked spark plugs, cleaned connections, changed fluids, filters and not sure what to do.