The proper wiring for a 3 way switch depends on where the switch falls in the circuit. When i put all 3 black together and all3 white together the light works as long as the switch is in the off position.

Installing Wemo Smart Light Switch When There Are 3 Black Wires
Why would a light switch have 3 black wires. Connect either of the other two black wires to the other screw on the switch. There should be a white black and one bare wire used for grounding. At the 3 way switch the white cable wire is marked black and connected to the common terminal. Most likely one of the 2 that are on the same side of the switch is power in but its also possible the one by itself is and the other wires each go out to a different one of the lights controlled by the switch. The other two black wires trigger no response. Only 1 of the black wires seem to be hot lights up the voltage tester when touching the 3 whites and one black together.
At the other end the white wire is marked black again and spliced to the black wire running the hot terminal on the light. Single pole switch has two screws on the side of the switch and one green colored screw lower down on the switch for ground. I dont know why there would be 3 black wires running to this switch. I have 3 white wires and 3 black wires in a light fixture. Single pole switch with 3 black wires. One of the two non hot black wires is the light feed and the other is a feed to other loads possibly some receptacles but it doesnt matter.
The black and red wires running between the switches connect the travelers together. With the power off connect the black hot wire to the old switch. The two switches can come before or after the light fixture in the circuit or you can have one switch on each side with the fixture in the middle. Remember that 3 way switches always appear in pairs.