Short answer
These are the three redundant temperature sensors for the windscreen anti icing and defogging system. The design is similar to what is found on the A330 and A340, and most large aircraft. The sensors are used to control the electric current in the heating film(s) sandwiched in the windscreen ply. Usually three temperatures are monitored:
- Outer windscreen layer must be above freezing point, e.g. 1.8°C.
- Film mustn't overheat, depends on film used.
- Inner layer must be below some threshold, e.g. 50°C.
This video shows how windscreen heating works on an ATR42. Extract related to the sensors:

ATR42 windscreen temperature sensors and film bus bars
The heating film(s) is/are used both to prevent icing and failure of the outer panel (air temperature can be as low as -60°C) and fogging on the inner panel. This can be obtain using a single film, but sometimes there are two distinct films:

Structure of the windscreen on a Boeing 787. Source
On the A350
From A-350 Technical Training Manual:

Windows Anti Icing/Defogging Function, Description and Interfaces
The windows anti icing/defogging system is divided into two
sub-systems (F/O and CAPT). Each sub-system is comprised of one
windshield, one FWD lateral window, one AFT lateral window and a
Window Heat Computer (WHC). [...]
The anti icing and defogging function of the cockpit
windshields is ensured by the heating of one resistive/heating film. Each
windshield's resistive heating film is powered by 230 VAC, provided by
the WHC.
There are three temperature sensors near the heating film that
continually send information to the WHC for the heating regulation and
the overheat protection functions. [...]
The WHC regulates the temperature of the cockpit windows (35 degrees C to
42 degrees C) based on the temperature value it receives from one of the three temperature sensors. The other two temperature sensors are
in standby mode. [...]
If the temperature of the cockpit windows reaches a specific
temperature level (+60 degrees C), the WHC will stop supplying the
specific window. [...] For each window, the WHC uses temperature
values from the three temperature sensors to detect an overheat.
The WHCs interface and exchange data via CRDCs with the
AFDX network.The two WHCs are located in the cockpit: WHC1 is located
next to the fourth occupant console behind the Captain. WHC2 is
located next to the coat stowage behind the First Officer.
For this test aircraft:
- Sensors are larger than usual.
- They may be stuck on the glass instead of being built-in.
This setting might be specific for flight test purposes. Someone may bring additional elements.
Another example, on a Pilatus PC12-NG:

Pilatus PC12-NG temperature sensors and bus bars on the windscreen