All fuel injected engine have two coolant temp "sensors", only one is really a sensor.
The two wire ECT sensor is used by the computer to adjust air/fuel mix as engine warms up, like an electronic choke.
One wire temp sender is used by the dash board gauge to relay engine temp to driver.
They are usually both located by the thermostat, so near where upper radiator hose attaches to engine.
You of course want the 1 wire SENDER.
Remove that 1 wire connector
Turn on key
temp gauge should be all the way down or all the way up, doesn't matter which but must be all the way.
Now use another wire to Ground the 1 wire, to engine or negative battery terminal.
Gauge will go all the way up or all the way down, the opposite of what it did before, but all the way.
If gauge acts correctly then wire and gauge are fine replace SENDER.
Make sure you open the box at the parts store, many parts guys don't know the difference and will give you the wrong part, the 2 wire one won't work.
Do not use "tape" on a sender, temp or oil pressure senders use the engine as a ground so need a few bare threads to get a good ground to the engine.
Clogged by-pass hoses can cause temp in engine to rise and fall randomly, wouldn't matter going uphill or down or stopped, would be random.
By-pass hoses are part of the heater system hoses.
Rising temp when stopped at a light would be a failing fan clutch.