Let hope history continues to repeat itself again and again when it comes to creating new jobs to replace the old.
But each time, it seems, takes less and less time (we were farmers for thousands of years, hunter gatherers for hundreds of thousands of years but the industrial revolution is only a couple hundred years old).
And when we can no longer use humans? I don't know, but it seems that the only way we can ever end up in that situation is if we have achieved general ai, which is to say that we will be at the cusp of the singularity.
The industrial revolution may have made the work horse obsolete, but it had only one use. Humans have many.
Capitalism is just a mechanism for allocating resources, it's not any kind of moral judgment on anything.