Can i use Jmeter to measure the performance of a specific action in a non-web based application. If so which sampler should i use?
For non-web based application, have a look at Sikuli. Sikuli automates anything you see on the screen. It uses image recognition to identify and control GUI components. It is useful when there is no easy access to a GUI's internal or source code.
Most probably the answer is yes, it depends on what protocol(s) your application is using, JMeter is a multiprotocol tool and it can mimic the following protocols out of the box:
- FTP via FTP Request sampler
- Databases via JDBC Request sampler
- LDAP via LDAP Request sampler
- Mail via SMTP Sampler and Mail Reader Sampler
- MQ via JMS Samplers
- Custom protocols via JSR223 Sampler or Java Request sampler or JUnit Request sampler (you may need to have extra libraries in JMeter Classpath)
See How to Run Performance Tests of Desktop Applications Using JMeter to get the overall idea and some insights.