I have done automation script for web application by webdriver sampler using groovy for mesure client side performance.
can i use this script to generate load to server in headless mode and measure the client side performance of the application by another copy same script without checked headless?
The difference is that:
Theoretically you can run your WebDriver Sampler scripts in a multithreaded manner, just add the desired number of threads (virtual users) in the Thread Group
and JMeter will kick off as many browser instances (no matter headless or GUI) as there are threads.
However be informed that using Selenium for performance testing is neither recommended by Selenium developers:
nor by WebDriver Sampler developers
The main reasons are in:
So I would rather recommend to conduct the main load using JMeter's HTTP Request samplers (just make sure that JMeter is configured to behave like a real browser)
Your existing Selenium tests can be used for measuring the frontend performance