Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C55C6200D0B for ; Wed, 27 Sep 2017 17:50:56 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C3FB51609CA; Wed, 27 Sep 2017 15:50:56 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 143D41609BC for ; Wed, 27 Sep 2017 17:50:55 +0200 (CEST) Received: (qmail 27457 invoked by uid 500); 27 Sep 2017 15:50:55 -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 27446 invoked by uid 500); 27 Sep 2017 15:50:55 -0000 Delivered-To: apmail-jakarta-jmeter-user@jakarta.apache.org Received: (qmail 27443 invoked by uid 99); 27 Sep 2017 15:50:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Sep 2017 15:50:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 9AB8618117E for ; Wed, 27 Sep 2017 15:50:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.422 X-Spam-Level: ** X-Spam-Status: No, score=2.422 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_ENVFROM_END_DIGIT=0.25, NML_ADSP_CUSTOM_MED=1.2, SPF_HELO_PASS=-0.001, SPF_SOFTFAIL=0.972] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id RQHNZYL2E2qz for ; Wed, 27 Sep 2017 15:50:52 +0000 (UTC) Received: from n5.nabble.com (n5.nabble.com [162.253.133.81]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 1383C60F4E for ; Wed, 27 Sep 2017 15:50:52 +0000 (UTC) Received: from n5.nabble.com (localhost [127.0.0.1]) by n5.nabble.com (Postfix) with ESMTP id 44DE9984C22 for ; Wed, 27 Sep 2017 08:50:51 -0700 (MST) Date: Wed, 27 Sep 2017 08:50:51 -0700 (MST) From: ZK To: jmeter-user@jakarta.apache.org Message-ID: <1506527451279-0.post@n5.nabble.com> In-Reply-To: References: Subject: Re: How to read full data from a txt file by using Beanshell script MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit archived-at: Wed, 27 Sep 2017 15:50:57 -0000 Hi, this would do it: import org.apache.jmeter.util.JMeterUtils; String fileContents = new File('./nameOfFileToRead.txt').getText('UTF-8'); vars.put("your_fileContentsVariableName",fileContents); println(fileContents); Use a JSR223 Sampler with the language set to groovey This script assumes the 'nameOfFileToRead.txt' is in your jmeter bin folder ZK -- Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org For additional commands, e-mail: user-help@jmeter.apache.org