Test ofSerial connection without having an actual serial por

Is there a way to test ofSerial connection without actually having a physical serial port?

I was looking at com0com and other virtual serial port emulators but was unable to get ofSerial to detect the ports created by these software.

why do you need to do this?

you could get an arduino board, it has a built-in FTDI usb to serial convertor and with the arduino application you can open up a serial monitor…

I know this is an old topic but it shows up on Google’s search results page.
This is for people who end up here due to Google.

With Windows, COM1-9 work fine with simple serial.setup(,);

If however, com0com is used and/or your port number is COM10 or higher, you need to use a different notation when opening the port. Else you get an “Unable to open com port” error.
The solution is:

serial.setup("\\\\.\\COM18", 9600); //eg for COM18, note the extra slash