Within my java code, how can I access a value stored in the JMeter test plan (jmx file)? Specifically trying to get ThreadGroup.num\_threads so my test code can know how many threads are being used in the test.

Thanks for the replies. Here's the code I ended up using:

```
    int testThreadCount = 0;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document testPlanFile = builder.parse(new File("path/to/testplan.jmx"));
    NodeList nodes = testPlanFile.getElementsByTagName("stringProp");
    for (int i = 0; i < nodes.getLength(); ++i)
    {
        Node node = nodes.item(i);
        Element element = (Element)node;
        String propName = element.getAttribute("name");
        if (propName.equals("ThreadGroup.num_threads"))
        {
            testThreadCount = Integer.parseInt(element.getChildNodes().item(0).getNodeValue());
            break;
        }
    }

```