On 11 March 2012 17:23, Pratik Dam <[email protected]> wrote: > Hi Sebb , > The problem with that is the testListener interface only lets > you implement /override testEnded , testStarted , testIterationStart > events . That's OK if I want to capture test Activity like > Starting , Stopping but the requirement here is to be able > to call a Web Service on clicking of the File->Save .
Why would you need to do that? That seems completely out of scope for JMeter. > I went to ActionRouter as I want to be able to add a > PreActionListener OR PostActionListener for ActionName.SAVE . Is > there an alternative approach for this ? No, JMeter is not designed for such use. Though of course it is open source so you can do what you want for your own purposes. > Thanks for the help > > Pratik > > > > > > > > > > On Sun, Mar 11, 2012 at 6:27 PM, sebb <[email protected]> wrote: >> >> On 8 March 2012 22:11, Pratik Dam <[email protected]> wrote: >> > Hi JMeter Dev , >> > I have a question on the right usage of ActionRouter Class >> > . I have a Jmeter listener where I want to do certain >> > activity >> > like a Web Services call before the Test is run (TestName.Start) >> > happens . >> > >> > >> > So in the init method of my listener I have a few register >> > calls >> > >> > c_save =Class.forName("org.apache.jmeter.action.Save") ; >> > ActionRouter.getInstance().addPreActionListener(c_save, >> > pre_save_listener); >> > >> > and pre_save_listener looks like this >> > ================================= >> > >> > save_listener = new ActionListener() { >> > >> > @Override >> > public synchronized void actionPerformed(ActionEvent e) { } >> > >> > >> > ....public void pre_save_listener(){ >> > do_something_here() >> > } >> > >> > };} >> > >> > All of this is fine . But am not able to deregister cleanly . >> > >> > I want to a deregistration call on the Exit Button . The call >> > seems to happen but I notice that the de-registration process is >> > not >> > clean . Now the deregistration process looks like a few calls >> > ActionRouter.getInstance().removePostActionListener(c_close, >> > post_close_listener); >> > >> > Please advise whats the best/right way to do this >> >> The ActionRouter class is intended for handling JMeter GUI events >> (e.g. button press). >> >> It should not be used in Listener code. >> >> You probably want to implement the TestListener interface. >> >> > Thanks >> > Pratik > >
