Return-Path: Delivered-To: apmail-jakarta-jmeter-user-archive@www.apache.org Received: (qmail 59617 invoked from network); 5 Jun 2004 00:53:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 5 Jun 2004 00:53:59 -0000 Received: (qmail 81493 invoked by uid 500); 5 Jun 2004 00:54:13 -0000 Delivered-To: apmail-jakarta-jmeter-user-archive@jakarta.apache.org Received: (qmail 81460 invoked by uid 500); 5 Jun 2004 00:54:13 -0000 Mailing-List: contact jmeter-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "JMeter Users List" Reply-To: "JMeter Users List" Delivered-To: mailing list jmeter-user@jakarta.apache.org Received: (qmail 81423 invoked by uid 99); 5 Jun 2004 00:54:12 -0000 Received: from [206.190.39.87] (HELO web52205.mail.yahoo.com) (206.190.39.87) by apache.org (qpsmtpd/0.27.1) with SMTP; Fri, 04 Jun 2004 17:54:12 -0700 Message-ID: <20040605005345.25874.qmail@web52205.mail.yahoo.com> Received: from [198.175.229.3] by web52205.mail.yahoo.com via HTTP; Fri, 04 Jun 2004 17:53:45 PDT Date: Fri, 4 Jun 2004 17:53:45 -0700 (PDT) From: Remedy QA Subject: Re: While loop functionality To: JMeter User List MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I tried with the June 3rd nightly build and this workaround for a while loop isn't quite working. There are two problems: 1. Using the Test Action sampler doesn't execute the IF condition at all--only when I put a "real" sampler like an HTTP Request sampler. 2. The IF condition only evaluates once. When the loop executes a second time, the IF condition doesn't seem to evaluate at all and therefore, the loop ends. I made sure the IF condition should evaluate by setting the condition to 1 == 1. I read in previous messages that other users have seen similiar behavior but no resolution was given. I tried searching through bugzilla for such a bug but didn't see one. Has anyone tried this while loop workaround? For the User Parameters, should the Update Once Per Iteration be unchecked? thanks, mabel -------------------------------------------------------------------------------- From: Thad Smith Subject: Re: While loop functionality Date: Thu, 29 Apr 2004 12:23:30 -0700 -------------------------------------------------------------------------------- Actually there is a way to do this. I've made some modifications to the ForLoop controller to allow it to use a JMeter variable as a loop counter. What you do is initialize a JMeter variable to 1...and use that JMeter variable as the loop counter. If you want to loop again then increment the counter variable and you'll loop again. Your test tree would look something like: Test Plan | Thread Group | MatchTest | User Parameters i=1 /pages/login.jsp /pages/j_security_check /pages/main.do /pages/top.jsp /pages/test.tst LoopController Loop Count: ${i} | /pages/taskList.do | Regular Expression Extractor Reference Name: done Regular Expression: Done Template: true Match No: 1 Default Value: false If Controller Condition: !${done} | User Parameters i=${__javaScript(${i}+1,)} Test Action Target: Current Thread Action: Pause Duration: 0 /pages/logout.do Basically, what's happening here is that you are going to execute the /pages/taskList.do http request at least once. If the text Done is found than the JMeter varible ${done} is set to true, else false. The If Controller is a child of the Loop Controller and increments the value of ${i} if !${done} is true (the text "Done" wasn't found). You have to stick the Test Action in the if controller because the controller won't execute at all if it doesn't have a sampler to sample. Test Action is a new Sampler that I added a few weeks ago that will either pause or stop the current thread or the entire test based on how you set it up. It's a sampler because that was the only way to introduce this functionality without completely rewriting JMeter. Plus, I think it's pretty convenient for use in the above scenario...It basically pauses the test for 0 milliseconds. The Test Action sampler doesn't actually return a sample. You can use any other sampler in its place for that matter. Note: The above scenario only works with the current code in the nightly build. Regards, Thad Smith P.S. There has been talk of creating some eclipse plugins that allows you to run JMeter inside of a Java program in eclipse, but nothing has been done yet. --- Hans Then <[EMAIL PROTECTED]> wrote: > Jordi Salvat i Alabart wrote: > > > Not currently. > > > > Jacqui Guerrero wrote: > > > >> Is there a way to simulate a while loop in the > test plan? > > > More generally, is there a way to create the test > plan in a programming > language? Is it possible to call the Java objects > that execute the test > plan directly from a Java program. The functionality > I am looking for is > somewhat like HttpUnit, but with the focus on > load-testing, so I also > need the stress-engine and the reporting facilities. > This would make > simulating complex user interactions less difficult > than it is using > only a GUI. > > Hans Then __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: jmeter-user-help@jakarta.apache.org