-1

I have done till creation of proxy sever.Facing some socket broken issue on running the scripts in firefox

When i perform some actions everything is working then some error occurs

also explain what is jmeter tree model and jmeternode is?

        Scanner sc = new Scanner(System.in);
//  recordingController recordingcontroller=new recordingController("testrecorder",RecordController.class);
//  RecordingController rc= (RecordingController) recordingcontroller.buildTestElement();


        RecordingController rc = new RecordingController();
        GenericController gc = new GenericController();
        rc.initialize();

        gc.addTestElement(rc);

        LoopController loopController = new LoopController();
        loopController.setLoops(1);
        loopController.setFirst(true);
        loopController.setProperty(TestElement.TEST_CLASS, LoopController.class.getName());
        loopController.setProperty(TestElement.GUI_CLASS, LoopControlPanel.class.getName());
        loopController.initialize();

        rc.addTestElement(loopController);
        ThreadGroup threadGroup = new ThreadGroup();
        threadGroup.setName("Thread-Group");
        threadGroup.setSamplerController(loopController);


        ProxyControl proxyController = new ProxyControl();
//  proxyController.setProperty(TestElement.TEST_CLASS, ProxyControl.class.getName());
//  proxyController.setProperty(TestElement.GUI_CLASS, ProxyControlGui.class.getName());
        proxyController.setName("Proxy Recorder");
        proxyController.setPort(4444);
//  threadGroup.setSamplerController(rc);
//           proxyController.setSamplerTypeName("SAMPLER_TYPE_JAVA_SAMPLER");


        TestPlan testPlan = new TestPlan("My_Test_Plan");
        testPlan.addTestElement(threadGroup);
        testPlan.addTestElement(proxyController);


        JMeterTreeModel jtm = new JMeterTreeModel();
        proxyController.setNonGuiTreeModel(jtm);
        JMeterTreeNode node = new JMeterTreeNode(proxyController,jtm);

//           JMeterTreeNode node=new JMeterTreeNode();
        proxyController.setTarget(node);
//        proxyController.setCaptureHttpHeaders(true);
//        proxyController.setUseKeepAlive(true);
//        proxyController.setGroupingMode(4);

        proxyController.setCaptureHttpHeaders(true);
        proxyController.setProxyPauseHTTPSample("10000");
        proxyController.setSamplerFollowRedirects(true);
        proxyController.setSslDomains("www.geeksforgeeks.org");
        proxyController.startProxy();

1 Answers1

0

I don't think non-GUI proxy recording is something you can achieve with vanilla JMeter, if you have to automate the recording process you will have to go for desktop applications automation solutions like Appium or LDTP

If you need to record a JMeter script using Firefox on a system which doesn't have GUI I can think of following approaches:

  1. Use Proxy2JMX Converter module of Taurus tool
  2. Use BlazeMeter Proxy Recorder (by the way it has nice feature of exporting recorded scenarios in "SmartJMX" mode with automatic detection and correlation of dynamic parameters)
Dmitri T
  • 159,985
  • 5
  • 83
  • 133