Can we integrate appium with jmeter for performance testing
I need to do performance testing for native mobile apps. Is there any way that I can integrate the appium with jmeter so I can generate the scripts for the same to generate load or capture server metrics
You can integrate JMeter with Appium quite easily by:
putting Appium Java Client with all its dependencies to JMeter Classpath
restarting JMeter
adding JSR223 Sampler and writing your Appium code in Groovy
and generate scripts for the same but you won't be able to "generate load" for the same because each instance of AppiumDriver can only control one device (or emulator) at a time so in order to simulate 100 users you will need either 100 real devices or 100 emulators, moreover it will be quite tricky to collect and correlate performance metrics. So I would rather recommend simulating your application network footprint using relevant JMeter Samplers or Plugins than trying to conduct the load using Appium.
Related
I need some input from loadrunner/jmeter experts.
I'm having automation scripts which is written in selenium+ java .
Can i use same scripts to do performance testing using loadrunner/jemeter.?
why i want do like this : to maintain single code base. if any changes happen so i will able to correct at one place and use it for UI Automation and performance testing.
Any help appreciate.
Selenium automates browsers that it!
Jmeter is specifically to use for Performance test. to be more specific either stress testing or load testing.
JMeter and Selenium can be used together for load testing of a website. Selenium is used to perform load testing and JMeter is used to measure the performance of the same. One can measure how fast HTML pages take to load, and also check javascript and CSS performances. This is done using a combination of the graphical JMeter interface and some scripting to invoke Selenium code.
Please read more about it here
JMeter and Selenium are both used for web application testing. But the main difference is that JMeter is mostly used to test the performance of web applications under load and stress. On the other hand, Selenium is best suited for automation and cross browser testing of a website. Based on what type of testing is necessary for the project, one can choose JMeter or Selenium or integrate both if that serves their purpose.
Theoretically yes, it is possible, but it is not recommended even by Selenium developers, be informed of the following additional constraints:
Browsers are quite resource intensive, for example Firefox 94 needs 1 CPU core and 2 GB of RAM per instance so you can calculate how much RAM you will need to simulate, say, 100 users.
You won't get metrics and KPIs normally available as the result of a performance test run
Can i test native ios app with Jmeter using Simulator? Also, my app requires login.
If not what is the best tool i can use for that?
If you want to measure your application performance JMeter won't help you, it's a load testing tool which acts on a network protocol level.
So if you want to collect application-side performance metrics and detect slow parts of your application it's better to use Instruments (comes with Xcode), see i.e. How to find and fix slow code using Instruments article for more details.
JMeter can help you to simulate hundreds or thousands of iOS application users concurrently accessing the backend or database, but this is the test against the backend, not against the application. If this is something you're interested in you could record your mobile application traffic using JMeter's HTTP(S) Test Script Recorder and once done replay it with increased number of virtual users to see how your backend handles the load. Check out Load Testing Mobile Apps Made Easy article for the overall concept.
In your opinion which will be better the record or the creation of the scripts by Exemple with selenium and junit?
Does the record method allow test visibility and maintainability of the code?
JMeter(Open Source)/LoadRunner(Licensed) are the most popular tools for performance testing(Load testing). Selenium is not the right choice for this job, it is the automation tool for web applications.
If you want to start in performance testing, I would suggest you to use JMeter for this job.
It is not a good way to use selenium for load testing, But Jmeter's main purpose is to do performance testing on web applications. So Jmeter is the right tool to to do performance related testing.
Selenium is a browser automation framework, it means 1 virtual user will kick off a real browser instance and modern web browsers are very CPU and memory intensive, for example Firefox 72.0.2 requires 1 CPU core and 2 GB or RAM per browser instance.
JMeter in its turn operates on HTTP protocol level which has much less footprint.
So if you need to simulate large number of users - it's better to consider JMeter.
If you're doing client-side performance testing (measure JavaScript execution time, page rendering speed, etc.) - go for Selenium.
If you need both - create main load with JMeter and use 1-2 virtual users running Selenium
Check out How to Convert Selenium Scripts into the JMX Converter article to learn how Selenium tests can be transformed into JMeter using Proxy2JMX service of the Taurus tool
We have a wintop application written in Java mainly. Can we use Apache jmeter to do load testing of 300 users for desktop application?
If you use command line Parameters, maybe, but it is not made for Testing of GUI Applications. For that, you Need robots like assertj-swing, or what you used for programming.
How do you imagine 300 users of a desktop applications? A desktop application is normally being used by 1 user only therefore you rather need to user profiling tools (i.e. JProfiler or YourKit) in order to detect slowest components and perform all the necessary optimisations.
You can use JMeter only in the case when your desktop application relies on backend server(s), in this case you might want to check whether the backend is capable of supporting 300 concurrent desktop applications. Also be aware that you need to assess the network protocol(s) your application uses - JMeter has to support it in order to be used for testing. If you're lucky enough and your application uses HTTP (or HTTPS) protocol - you will even be able to record it using JMeter's HTTP(S) Test Script Recorder, check out How to Run Performance Tests of Desktop Applications Using JMeter article for more details.
I am using JMeter for API Testing. Using HTTP Request and Beanshell I am able to achieve this.
There are times where the Services are down for a weeks time.
Since I the have the Request and Response with me, I would like to implement Service Virtualization using JMeter.
Even when the Services are down, I should be able to continue my testing.
Can I achieve Service Virtualization in JMeter? If yes, can I request you to let me know the steps please.
No you can't.
I suggest you check out API simulation tools which will allow you to do service virtualization. You can then use JMeter to run your tests and an API simulation tool to mock the dependencies.
JMeter doesn't do Service Virtualization, but you can use JMeter in recording, see article:
You can import the incoming traffic to JMeter using tcpreplay and
JMeter Proxy. Run a test suite in your performance environment using
JMeter and use the virtual services to decouple yourself from other
dependencies. Just to be safe, repeat the recording process every
week. This could prove to be very easy or very difficult to implement
depending on the specifics of the system you are working with.