Return-Path: X-Original-To: apmail-jmeter-user-archive@www.apache.org Delivered-To: apmail-jmeter-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DC3CB9E4F for ; Fri, 10 Feb 2012 03:08:38 +0000 (UTC) Received: (qmail 4303 invoked by uid 500); 10 Feb 2012 03:08:38 -0000 Delivered-To: apmail-jmeter-user-archive@jmeter.apache.org Received: (qmail 3725 invoked by uid 500); 10 Feb 2012 03:08:26 -0000 Mailing-List: contact user-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "JMeter Users List" Delivered-To: mailing list user@jmeter.apache.org Received: (qmail 3712 invoked by uid 99); 10 Feb 2012 03:08:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Feb 2012 03:08:20 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of galactoise@gmail.com designates 74.125.82.45 as permitted sender) Received: from [74.125.82.45] (HELO mail-ww0-f45.google.com) (74.125.82.45) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Feb 2012 03:08:13 +0000 Received: by wgbdt12 with SMTP id dt12so1961044wgb.26 for ; Thu, 09 Feb 2012 19:07:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=2plS1r7hjqW8oOnHKCM8W8L9Mg+ra7kSW7UD+PHSBGE=; b=qjwm0CvbkSjEBAY7+WeV+sSlLVS/Uf/ntOe6eZEif/zFzUcEu10aSaVox7K3LUT6/q Q2Sii/nBWF8mMQcNF29YOnLc+JBPAJm8hZwNuuXmZ8VlfvlE2f+2uHgoLlPXuqfu3FCp bfqy/HuLdChNMnNNqrGCogvX3Usv9LlS+WjVA= MIME-Version: 1.0 Received: by 10.180.14.129 with SMTP id p1mr6511727wic.16.1328843271841; Thu, 09 Feb 2012 19:07:51 -0800 (PST) Received: by 10.216.82.2 with HTTP; Thu, 9 Feb 2012 19:07:51 -0800 (PST) Date: Thu, 9 Feb 2012 19:07:51 -0800 Message-ID: Subject: Sharing arrays between threads. From: Eric Olson To: user@jmeter.apache.org Content-Type: multipart/alternative; boundary=f46d040fa2742e26b204b8936f46 --f46d040fa2742e26b204b8936f46 Content-Type: text/plain; charset=ISO-8859-1 Hi, I'm having a terrible time figuring out how to share an array of strings between different parts of my test plan. The problem I'm trying to solve is that i want to "log in" all of my users up front to get a big list of tokens (using OAuth 2.0), and then when I move on to the actual load testing section of my test plan, I can just have it randomly pick a token from my array. The way I've been trying to do it is: -Define an array using a BSF preprocessor (via javascript) and add it to vars (vars.putObject("myArray", myArray);) -In the auth thread group, parse the response using regular expressions putting it into a temporary variable -In the auth thread group, use a BSF postprocessor retrieve my previously created array and add the temporary variable from the step above to the array, and put it back in vars -In my test thread group, which does not start running until my auth step is completed, each thread randomly picks from the array defined at the test plan level. The problem I'm running into seems to be that there is some sort of scope issue where the data added during the auth step is not available to the test step - only what was predefined in the top-level preprocessor. Am I doing this completely wrong, or what? Can Arrays not be shared? If so, how do you use data gathered from one step in the next step? Thanks, Eric --f46d040fa2742e26b204b8936f46--