I think it will be something like how leading up to WW1 everyone assumed that the wars of the future will be fought via aerial bombardment. People thought it would decrease the need for soldiers in combat. In fact, it just increased the need for soldiers because we raised new points of interest to target and new forms of counter weaponry. I think something similar will happen with robots. The most obvious technological advancements would be something like EMP and the need to take down centralized hubs etc. The human element will just adapt to change their combat tactics around the new form of weaponry and then they'll just be another military tool like planes, tanks, mines.
Maybe if you just used them in smaller theaters of combat like drones they might for the most part replace human soldiers, but I think their very presence on a battlefield would ensure that whatever strategy they undertake will be countered enough to warrant human intervention. There will probably be a short period as with aerial combat in which people think the human element in combat will be gone, but a few adaptations later they'll be right back there. Of course, everytime in human history, we start playing around with new weapons it tends to lead to a major war.