Internet connection dropping out frequently
My iMac keeps losing its internet connection. Wifi stays on (full signal on menu bar) but web pages won't load. Other devices in the room continue to work. I can force it to reconnect by turning off wifi from drop-down menu then immediately turning it on again and it always reconnects. It does this several times a day. I have had this problem for a year or so and have lived with it but I'm losing my patience. There appear to have been many other people with similar problems over the years but I have never found a post with a satisfactory solution.
I know there are several tools for diagnosing network connections but the problem is intermittent so I don't know which tool would show it. Any ideas please?
iMac, macOS Sierra (10.12.6)