Happens to me a lot - HP laptop - connected to my Modem via WiFi but no Internet Access, whilst the desktop is receiving Internet OK via an Ethernet cable from the same Modem, and an iPad is receiving the WiFi signal and the Internet.
Haven't tried tried the f12 gambit, will so so next time, but Troubleshooting comes up with nonsense ( can't remember the exact wording ) but if I completely shut down the laptop and the modem, make a cup of tea, then fire everything up again it works ( just doing a Restart has no effect, I have to close down completely )
My IT Guru says HP fitted a batch of cheap WiFi reception cards some time ago and wants to fit a different, expensive, one that he has sourced. Can't comment, for now I live with it.