It goes something like this: Kamerlingh Onnes' lab had successfully liquified helium—a major feat in its own right—and created an apparatus that could create and maintain cryogenic temperatures. They started experimenting with different materials to find out when and how their resistance might drop to zero. But when they chilled mercury to the temperature of liquid helium, they found it had zero resistance—which, they thought, couldn't be right and set it down a short-circuit in the apparatus. They kept redoing the test, though, and getting the same result. Van Delft writes:
"What in heaven's name was going on? The answer did not dawn until the 'blue-collar boy' operating the oil manometer [which kept the pressure constant] dozed off, with the result that the pressure in the helium cryostat slowly rose and the temperature rose from just below 4 K to the boil point of helium, 4.25 K. When the transition or critical temperature was passed at which a superconductor regions electrical resistivity, Holst, in lab I, suddenly saw his galvanometer needle swing to the side. Finally, the truth dawned; Leiden had discovered superconductivity."
This was the story that dominated for years—superconductivity was a chance discovery. Nobody knew anything else because Onnes hadn't been keeping notes. But it turns out that Onnes had been taking notes; it's just that no one had looked carefully enough at them to find these particular notations. When Van Delft when back a few years later and reinspected the lab books, he did find, he wrote in a 2010 Physics Today article, notes from discovery of superconductivity.
The story in those notebooks, though, was less dramatic. In an initial experiment, Kamerlingh Onnes and his team tested three hypotheses—mercury's resistance should be smaller at 4.3 K than at 14 K (but still measurable); its resistance should be a variable independent of temperature; and at very low temperatures it should become zero—and found them all to be true. In a second experiment, the team documented—on purpose—the resistance of mercury as the temperature rose. (No sleepy lab boy needed—they knew they were letting it rise.)
It was, though, a surprise to see mercury's resistance jump so dramatically, from 4.19 K to 4.2 K—the critical temperature of mercury's superconductivity. Kamerlingh Onnes, Van Delft writes, hadn't expected the transition to be so abrupt. But, it turned out, that's just how superconductivity worked. It hadn't been exactly what he had meant to find, but it was something new.