Capturing local network traffic is a difficult task for many tools, including WireShark. Do not worry, there is a very simple solution to this problem!
Just use RawCap!
RawCap is a tiny (23KB) application that can capture local traffic and then write that to a pcap (packet capture) file, which can be opened by tools like WireShark! Please note that when using this you must specify your target address as 127.0.0.1, not just localhost.