Return-Path: Delivered-To: apmail-jakarta-jmeter-user-archive@www.apache.org Received: (qmail 43184 invoked from network); 12 Nov 2009 18:01:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Nov 2009 18:01:09 -0000 Received: (qmail 37539 invoked by uid 500); 12 Nov 2009 18:01:08 -0000 Delivered-To: apmail-jakarta-jmeter-user-archive@jakarta.apache.org Received: (qmail 37503 invoked by uid 500); 12 Nov 2009 18:01:08 -0000 Mailing-List: contact jmeter-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: 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 37493 invoked by uid 99); 12 Nov 2009 18:01:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Nov 2009 18:01:08 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of shettyd@gmail.com designates 209.85.216.204 as permitted sender) Received: from [209.85.216.204] (HELO mail-px0-f204.google.com) (209.85.216.204) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Nov 2009 18:01:06 +0000 Received: by pxi42 with SMTP id 42so1708088pxi.5 for ; Thu, 12 Nov 2009 10:00:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=lSJYiBhQTaM7SPE0nuIKpyttZgzW/sSgdyOmpLXg4xA=; b=mgrVWvJV1CIJYkik05JkDrVevDYUxLvzxLWZgddbz13THarTrXMMVFY5KCdnfjEayZ Ot5+yfOZCjfPC02mfmD4iJvHK3zr1mG0Fejpwo+jYKYkGt0Nu2KrD+QajO76wWiAp/dN Y0BrNhhEu2FVcp7NoViSFv5yR4mjsDNyLKzV0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=vq50N5wfDpn6VmlMewkx0E3oxvFsgCW76okdfC0nemWwKtg99PKZRK1c7mxY7zNxDs CCRo7i3LLiwDQiCaS3/b0CF6kghjr/V8GCKi6Uc8ocTJKDzsNRHyyPaJmD0w7oyMRC5l 5XAoDV8AU5V/Oj3/dKa+YARUGuQh7GJToO3Fk= MIME-Version: 1.0 Received: by 10.141.52.15 with SMTP id e15mr185215rvk.204.1258048846127; Thu, 12 Nov 2009 10:00:46 -0800 (PST) In-Reply-To: <88F60929FA931346A5B95D4A4A4AD648DFAD7A1414@ITEXCMB.wausaufs.nwk> References: <88F60929FA931346A5B95D4A4A4AD648B82B94E6D8@ITEXCMB.wausaufs.nwk> <88F60929FA931346A5B95D4A4A4AD648DFAD7A1414@ITEXCMB.wausaufs.nwk> Date: Thu, 12 Nov 2009 10:00:46 -0800 Message-ID: <4483c26c0911121000m2063deeaw5671ac77776c1fe6@mail.gmail.com> Subject: Re: Help With a Null Variable From: Deepak Shetty To: JMeter Users List Content-Type: multipart/alternative; boundary=000e0cd291d49563720478305216 --000e0cd291d49563720478305216 Content-Type: text/plain; charset=ISO-8859-1 hi you could do this at the beanshell level //check the number of brackets , this is pseudo code, also check that loopBatch always has a value that is the string //representation of an integer or an integer if(vars.get("BatchLink_g3")) == null || "".equals(vars.get("BatchLink_g3")).trim())){ vars.put("loopBatch","0"); } else { vars.put("loopBatch", vars.get("BatchLink_g3")); } OR You could do it as a javascript funtion (null means the value remains as ${loopBatch} and you'd have to pass it as a string so there be quotes around the ${loopBatch} regards deepak On Thu, Nov 12, 2009 at 9:38 AM, Steve Eckhart wrote: > I have a Regular Expression which is reading a variable from a web page. I > need to test this value to see if I should perform the next step or perform > another search. > > Currently, I have the following in a BeanShell PostProcessor to set the > value of the variable: > > vars.put("loopBatch", vars.get("BatchLink_g3")); > > If my search returned no results, a Debut PostProcessor will report > loopBatch=null. Then, the If Controller ${loopBatch} > 0 generates an error: > > ERROR - jmeter.control.IfController: missing ) after argument list > (#1) > > How can I test using a variable which might be null? I found a method of > the Class Abstract Property getIntValue() which would give me what I want (0 > when the value is null), but I don't understand how to use getIntValue() in > a JMeter script. > > Is this the right way to proceed? Am I missing something? I don't know much > about the BeanShell command. > > Thank you for any help. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org > > --000e0cd291d49563720478305216--