It's possible to weight different user-agents in Jmeter by using a csv data set. For example, and for simplification, let's imagine you have 5 different user agents with equal distributions of 20%. You could insert them into the csv, make 100 rows if you're splitting across multiple agents, and randomize the rows in excel.
If you're using this method to test multiple user-agents, make sure you configure the CSV Data Set Config correctly in Jmeter. Let's take the following user-agent for example:
|Mozilla/5.0 (Windows NT 6.1; Keynote LoadPro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36 If you used the default settings in the CSV Data Set Config for this setting, the user-agent might become truncated and look something like this, possibly causing issues on your application and with the scripts: Mozilla/5.0 (Windows NT 6.1; Keynote LoadPro) AppleWebKit/537.36 (KHTML. In order to avoid truncation for user agents, simply remove the "," from the Delimiter field. Additionally, you'll want to set the "Allow Quoted Data" field to "True." In this example, your final configuration would look something like this: