Can we write test cases in Selenium?

Can Selenium be used for writing test cases?

Yes. You can use the Selenium framework for writing test cases.