The oxygen sensor can be tested by observing the voltage fluctuation.
You will need to use a voltmeter to get started. It will require you to start the vehicle for about 15 minutes for everything to go to operating temperature. Then use the voltmeter to measure the voltage.
Here is a helpful guide that explains exactly what needs to be done:
Repair Safety Notice: This information is for general instructional purposes only. Vehicle repair can be dangerous. Verify all information, follow manufacturer service procedures, use proper tools and safety equipment, and consult a qualified repair shop when needed.