is it feasible to test mainframe, which is a desktop based application with selenium? If yes, then how?
Selenium allows to test any UI that can provide WebDriver implementation to interact with it.
If UI framework that runs your app provides a webdriver that can:
- associate the commands WebDriver implementations should implement with the particular actions on UI
- associate the way how the locators are built with the particular UI objects
then you can utilize that driver for your UI automation.
Selenium is browser automation tool.
It is commonly used to website test automation, but it is not limited to it.
Mainframe/desktop do not have HTML locators, which webdriver uses to locate webelements to be interacted with, AFAIK.
To be practical... you can perform automation to some extent. but not recommended. You might consider winium which implements the JSON wire protocol to automate windows based application(with limited achievability). I would suggest consider UFT with terminal emulator addin.