qileilove

          blog已經(jīng)轉(zhuǎn)移至github,大家請訪問 http://qaseven.github.io/

          jmeter之配置元件

          利用Jmeter的http請求的時候,例如登陸操作,我們做普通用戶名和密碼作參數(shù)化,循環(huán)讀取文本里的用戶名和密碼,可以添加CSV Data Set Config這個原件來控制。

          利用Jmeter的CSV Data Set Config,可以實現(xiàn)這個功能,具體如下:

          1.新建一個文本文件,里面保存要登錄的用戶名,密碼,文件內(nèi)容如下:

          baidu,123456

          coolsin,liujuan

          sb,123456

          說明:這里用英文逗號為分隔符,也可以用其他為分隔符,在CSV Data Set Config中可以設(shè)置。如果此文本文件為CSV格式的,則用豆號分格

          2.右鍵點擊Jmeter中需要參數(shù)化的某個請求,選擇添加——配置原件——CSV Data Set Config,會添加一個CSV Data Set Config,需要設(shè)置相關(guān)的一些內(nèi)容,具體如下:

          Filename:文件名,,指保存信息的文件目錄,可以相對或者絕對路徑(比如:D:\user.csv)

          Variable Names:參數(shù)名稱(如:有幾個參數(shù),在這里面就寫幾個參數(shù)名稱,每個名稱中間用分隔符分割,分隔符在下面的“Delimitet”中定義,為了和文件中的“,”對于,這里也用“,”分割每個參數(shù)名,(比如:use,password)

          說明:這里的username與password為自己定義的名稱,請求中要用這個名稱,例如${參數(shù)名稱}

          Delimitet:定義分隔符,這里定義某個分隔符,則在“Variable Names”用這里定義的分隔符分割參數(shù)。CSV默認(rèn)為英文的豆號

          Recycle on EOF:是否循環(huán)讀入,因為CSV Data Set Config一次讀入一行,分割后存入若干變量中交給一個線程,如果線程數(shù)超過文本的記錄行數(shù),那么可以選擇從頭再次讀入

          設(shè)置CSV Data Set Config如下圖所示:


           

          當(dāng)文本中參數(shù)運行完成后,再從第一個開始循環(huán)讀取,如果選擇為false,則停止運行

          備注說明:這里我用通俗的語言大概講一下Recycle on EOF與Stop thread on EOF結(jié)果的關(guān)聯(lián)

          Recycle on EOF :到了文件尾處,是否循環(huán)讀取參數(shù),選項:true和false

          Stop thread on EOF:到了文件尾處,是否停止線程,選項:true和false

          當(dāng)Recycle on EOF 選擇true時,Stop thread on EOF選擇true和false無任何意義,通俗的講,在前面控制了不停的循環(huán)讀取,后面再來讓stop或run沒有任何意義

          當(dāng)Recycle on EOF 選擇flase時,Stop thread on EOF選擇true,線程4個,參數(shù)3個,那么只會請求3次

          當(dāng)Recycle on EOF 選擇flase時,Stop thread on EOF選擇flase,線程4個,參數(shù)3個,那么會請求4次,但第4次沒有參數(shù)可取,不讓循環(huán),所以第4次請求錯誤


          3.在需要使用變量的地方,比如在登錄操作中,需要提交的表單字段包含用戶名密碼,我們就可以用${變量名}的形式進(jìn)行替換,例如${user}和${password}

          參數(shù)設(shè)置如圖所示:

          Allow quoted data?Should the CSV file allow values to be quoted? If enabled, then values can be enclosed in - double-quote - allowing values to contain a delimeter.


          pasting

          4. 最后,添加后,可以通過“添加-監(jiān)視器-查看結(jié)果樹(請求部分)”,來檢驗參數(shù)化是否成功,運行線程組,如果失敗,那么檢查一下文本的路徑,變量大小寫等等,手冊上說使用相對文本路徑時,要以測試配置文件(默認(rèn)是jmeter的bin目錄)的目錄為參考,但是我試過似乎不行,換成絕對路徑就可以了


          備注說明:

          1、使用這個元件做參數(shù)時,盡量用CSV格式的表格來做,我試過其它格式的dat和txt,都讀取不到

          2、這個元件要在該請求下單獨添加










          parameters


          AttributeDescriptionRequired
          NameDescriptive name for this element that is shown in the tree.No
          Clear cache each iterationIf selected, then the cache is cleared at the start of the thread.Yes
          Use Cache Control/Expires header when processing GET requestsSee description above.Yes
          Max Number of elements in cacheSee description above.



          ATTENTION:

          現(xiàn)在對于JMeter來說,一個測試計劃只能有一個cookie管理器。因為當(dāng)多個magager存在時,JMeter目前還沒有方法來指定使用那個manager。同時,一個cookie manager中的存儲的cookie也不能被其他cookie manager所引用,所以同一個計劃中不建議使用多個cookie manager

          HTTP COOKIE Manager管理cookie有兩種方法:
          1. 他可以像瀏覽器一樣存儲和發(fā)送cookie,如果你要發(fā)送一個帶cookie的http請求,cookie manager會自動存儲該請求的cookies,并且后面如果發(fā)送同源站點的http請求時,都可以用這個cookies。每個JMeter線程都有自己的“cookie存儲區(qū)域”,
            所以當(dāng)你測試一個使用cookie來管理session信息的web站點時,每個JMeter線程都有自己的session。
            注意:
          以這種自動收集的方式收集到的cookie不會在cookie manager中進(jìn)行展示,但是運行后,通過:查看結(jié)果樹(監(jiān) 聽器)可以查看到cookie信息。
           早期的JMeter版本(2.3.2或更早)對與cookie的管理是支持跨域的,也就是說不同域名的網(wǎng)站都可以使用cookie manager中  的cookie,2.3.2版本之后,這個就不可以了,必須同源,才能共用cookie,如果你想讓JMeter的cookie manager支持跨域,  修改JMeter.property :
          CookieManager.check.cookies=false

            接受到的cookie會被自動存儲在線程變量中,但是從Jmeter2.3.2版本后,默認(rèn)不再存儲,如果你想要manager自動存儲收集到 的cookie,你需要修改JMeter.property :
          CookieManager.save.cookies=true
              存儲的時候,cookie的key會以“COOKIE_”為前綴命名(默認(rèn)情況),如果你想自定義這個前綴,
          修改JMeter.property :
          CookieManager.name.prefix= 
              這個配置如果未啟用(也就是維持默認(rèn)),我們可以通過一下方式獲取到cookie的值:${COOKIE_name},其       中name為cookie的名稱

             2. 除了上面說的自動收集,我們還可以手動添加cookie,這里,筆者要給大家一個建議,盡量不要一個一個手動去填寫,我們可  以結(jié)合firefox的插件firebug,直接將cookie導(dǎo)入,操作如下
          • 打開firebug,如圖
          JMeter——HTTP COOKIE Manager(cookie管理器) - 一切隨緣 - 隨緣
             點擊紅色框中的,下拉框中有個導(dǎo)出本站點的cookie,就可以將cookie信息保存為一個cookies.txt文件,接著打開jmeter 的cookie manager:
          JMeter——HTTP COOKIE Manager(cookie管理器) - 一切隨緣 - 隨緣
            載入剛才導(dǎo)出的cookies.txt文件即可。
          各個參數(shù)說明:
          名稱 描述 是否必填
            Name 自定義該cookie的描述,例如:tuan.qq.com的cookie N
            Clear Cookies each Iteration 每次線程組運行前,都會清楚cookie,但是如果是手動添加的cookie,不會被清除 N
            Cookie Policy 選擇cookie的管理策略,建議選擇compatibility,兼容性強 
            User-Defined Cookies 用戶自定義cookie
           
            Add Button 。。。略過 

          HTTP信息頭管理器  信息頭部


          Parameters

          AttributeDescriptionRequired
          NameDescriptive name for this element that is shown in the tree.No
          Name (Header)Name of the request header. Two common request headers you may want to experiment with are "User-Agent" and "Referer".No (You should have at least one, however)
          ValueRequest header value.No (You should have at least one, however)
          Add ButtonAdd an entry to the header table.N/A
          Delete ButtonDelete the currently selected table entry.N/A
          Load ButtonLoad a previously saved header table and add the entries to the existing header table entries.N/A
          Save As ButtonSave the current header table to a file.

          HTTP授權(quán)管理器

          例如 授權(quán) 訪問 tomcat 這里主要是讓JMeter能夠通過Tomcat的基本認(rèn)證,獲取數(shù)據(jù),在“用戶名”和“密碼”中加入對應(yīng)的值


          AttributeDescriptionRequired
          NameDescriptive name for this element that is shown in the tree.No
          Clear auth on each iteration ?Used by Kerberos authentication. If checked, authentication will be done on each iteration of Main Thread Group loop even if it has already been done in a previous one. This is usually useful if each main thread group iteration represents behaviour of one Virtual User.Yes
          Base URLA partial or complete URL that matches one or more HTTP Request URLs. As an example, say you specify a Base URL of "http://jmeter.apache.org/restricted/" with a username of "jmeter" and a password of "jmeter". If you send an HTTP request to the URL "http://jmeter.apache.org/restricted/ant/myPage.html", the Authorization Manager sends the login information for the user named, "jmeter".Yes
          UsernameThe username to authorize.Yes
          PasswordThe password for the user. (N.B. this is stored unencrypted in the test plan)Yes
          DomainThe domain to use for NTLM.No
          RealmThe realm to use for NTLM.No
          MechanismType of authentication to perform. JMeter can perform different types of authentications based on used Http Samplers:
          SamplerAuthentications
          JavaBASIC
          HttpClient 3.1BASIC, DIGEST
          HttpClient 4BASIC, DIGEST and Kerberos



          http 默認(rèn)請求

          一個HTTP請求有著許多的配置參數(shù),下面將詳細(xì)介紹:

          名稱:本屬性用于標(biāo)識一個取樣器,建議使用一個有意義的名稱。

          注釋:對于測試沒有任何作用,僅用戶記錄用戶可讀的注釋信息。

          服務(wù)器名稱或IP :HTTP請求發(fā)送的目標(biāo)服務(wù)器名稱或IP地址。

          端口號:目標(biāo)服務(wù)器的端口號,默認(rèn)值為80 。

          協(xié)議:向目標(biāo)服務(wù)器發(fā)送HTTP請求時的協(xié)議,可以是http或者是https ,默認(rèn)值為http 。

          方法:發(fā)送HTTP請求的方法,可用方法包括GET、POST、HEAD、PUT、OPTIONS、TRACE、DELETE等。

          Content encoding :內(nèi)容的編碼方式,默認(rèn)值為iso8859

          路徑:目標(biāo)URL路徑(不包括服務(wù)器地址和端口)

          自動重定向:如果選中該選項,當(dāng)發(fā)送HTTP請求后得到的響應(yīng)是302/301時,JMeter 自動重定向到新的頁面。

          Use keep Alive : 當(dāng)該選項被選中時,jmeter 和目標(biāo)服務(wù)器之間使用 Keep-Alive方式進(jìn)行HTTP通信,默認(rèn)選中。

          Use multipart/from-data for HTTP POST :當(dāng)發(fā)送HTTP POST 請求時,使用Use multipart/from-data方法發(fā)送,默認(rèn)不選中。

          同請求一起發(fā)送參數(shù) : 在請求中發(fā)送URL參數(shù),對于帶參數(shù)的URL ,jmeter提供了一個簡單的對參數(shù)化的方法。用戶可以將URL中所有參數(shù)設(shè)置在本表中,表中的每一行是一個參數(shù)值對(對應(yīng)RUL中的 名稱1=值1)。

          同請求一起發(fā)送文件:在請求中發(fā)送文件,通常,HTTP文件上傳行為可以通過這種方式模擬。

          從HTML文件獲取所有有內(nèi)含的資源:當(dāng)該選項被選中時,jmeter在發(fā)出HTTP請求并獲得響應(yīng)的HTML文件內(nèi)容后,還對該HTML進(jìn)行Parse 并獲取HTML中包含的所有資源(圖片、flash等),默認(rèn)不選中,如果用戶只希望獲取頁面中的特定資源,可以在下方的Embedded URLs must match 文本框中填入需要下載的特定資源表達(dá)式,這樣,只有能匹配指定正則表達(dá)式的URL指向資源會被下載。


          Java請求默認(rèn)值

          可以使用該請求執(zhí)行java文件

          http://www.myexception.cn/internet/1218112.html
          用jmeter測試java程序

          最近在用jmeter進(jìn)行性能測試,防止被忘記,把步驟寫下。

           

          場景:測試java程序

           

          1、右擊測試計劃-> 添加 -> Threads(Users) -> 線程組

           

          2、設(shè)置線程屬性,用于并發(fā)請求。

             

                介紹:

           

                線程數(shù): 5

                Ramp-Up Period(in seconds) : 1

                循環(huán)次數(shù): 2

           

                含義:1秒種起動5個線程,每個線程循環(huán)調(diào)用2次java請求     

           

          3、線程組右擊 -> 添加 -> Sampler -> Java請求

           

                 之前建立測試類:

               

          package com.my.test;  import java.util.Random;  import org.apache.jmeter.protocol.java.sampler.AbstractJavaSamplerClient; import org.apache.jmeter.protocol.java.sampler.JavaSamplerContext; import org.apache.jmeter.samplers.SampleResult;  /**  * Hello world!  *  */ public class App  extends AbstractJavaSamplerClient{      	 	 	public static double computer(double a,double b){ 		return a * b / a * a; 	}  	@Override 	public SampleResult runTest(JavaSamplerContext arg0) { 		// TODO Auto-generated method stub 		SampleResult sr = new SampleResult(); 		sr.sampleStart(); 		 		Random random = new Random(); 		for(int i=0; i<10000; i++){ 			computer(random.nextDouble(),random.nextDouble()); 			 		} 		 		sr.setSuccessful(true); 		sr.sampleEnd(); 		return sr; 	}  	@Override 	public void setupTest(JavaSamplerContext context) { 		// TODO Auto-generated method stub 		super.setupTest(context); 	}  	@Override 	public void teardownTest(JavaSamplerContext context) { 		// TODO Auto-generated method stub 		super.teardownTest(context); 	} 	 	 }

           

             使用的jar包有:ApacheJMeter_java.jar ,ApacheJMeter_core.jar

             上述jar包在 %JMETER_HOME%/lib/ext/下

           

             將測試程序打成jar包,放在%JMETER_HOME%/lib/ext/下

           

             這里會自動識別出該類,選擇。

           

          4、線程組右擊 -> 添加 -> 監(jiān)聽器 -> 用表格察看結(jié)果

           

               Ctrl + R,開始運行,

               Ctrl + E,清除歷史結(jié)果



          JDBC Connection Configuration

           

          Database URL: jdbc:oracle:thin:@192.168.1.168:1521:ptoracl
          JDBC Driver class: oracle.jdbc.driver.OracleDriver
          Username: lianggzone
          Password:lianggzone

            附注:
            Database URL 格式:jdbc:oracle:thin:@[IP地址]:[端口號]:[實例名]
            用戶名、密碼就是連接數(shù)據(jù)庫的用戶名和密碼



          Parameters

          AttributeDescriptionRequired
          NameDescriptive name for the connection configuration that is shown in the tree.No
          Variable NameThe name of the variable the connection is tied to. Multiple connections can be used, each tied to a different variable, allowing JDBC Samplers to select the appropriate connection. Each name must be different. If there are two configuration elements using the same name, only one will be saved. JMeter versions after 2.3 log a message if a duplicate name is detected.Yes
          Max Number of ConnectionsMaximum number of connections allowed in the pool. In most cases, set this to zero (0) . This means that each thread will get its own pool with a single connection in it, i.e. the connections are not shared betweeen threads. 
          If you really want to use shared pooling (why?), then set the max count to the same as the number of threads to ensure threads don't wait on each other.
          Yes
          Pool timeoutPool throws an error if the timeout period is exceeded in the process of trying to retrieve a connectionYes
          Idle Cleanup Interval (ms)This is used to specify how long idle connections will be maintained in the pool before being closed. For a complete explanation on how this works, see ResourceLimitingPool.trim() (Defaults to "60000", 1 minute)Yes
          Auto CommitTurn auto commit on or off for the connections.Yes
          Keep-aliveThe keep-alive is used enable a mechanism to monitor the health of connections. If a connection has not been used for Max Connection Age (ms) then before returning the connection from a call to getConnection(), the connection is first used to ping the database to make sure that it is still alive. Setting the age allows the 5 second age to be overridden. Validation Query will be used to test it.Yes
          Max Connection Age (ms)Controls the age mentionned in "Keep-Alive" property. It means connections not used for more than Max Connection Age will be testedYes
          Validation QueryA simple query used to determine if the database is still responding.Yes
          Database URLJDBC Connection string for the database.Yes
          JDBC Driver classFully qualified name of driver class. (Must be in JMeter's classpath - easiest to copy .jar file into JMeter's /lib directory).Yes
          UsernameName of user to connect as.No
          PasswordPassword to connect with. (N.B. this is stored unencrypted in the test plan)No


          Keystore Configuration

          Control Panel

          Parameters

          AttributeDescriptionRequired
          NameDescriptive name for this element that is shown in the tree.No
          PreloadWether or not to preload Keystore. Setting is to true is usually the best option.Yes
          Variable name holding certificate aliasVariable name that will contain the alias to use for authentication by client certificate. Variable value will be filled from CSV Data Set for example. In the screenshot, "certificat_ssl" will also be a variable in CSV Data Set.False
          Alias Start IndexThe index of the first key to use in Keystore, 0-based.Yes
          Alias End IndexThe index of the last key to use in Keystore, 0-based. When using "Variable name holding certificate alias" ensure it is large enough so that all keys are loaded at startup.Yes
          LDAP Extended Request Defaults  and  LDAP請求默認(rèn)值

          可以添加一個config element中的LDAP Request Defaults用于控制一些共享默認(rèn)值.

          There are two ways to create test cases for testing an LDAP Server.

          1. Inbuilt Test cases.
          2. User defined Test cases.

          There are four test scenarios of testing LDAP. The tests are given below:

          1. Add Test
            1. Inbuilt test :

              This will add a pre-defined entry in the LDAP Server and calculate the execution time. After execution of the test, the created entry will be deleted from the LDAP Server.

            2. User defined test :

              This will add the entry in the LDAP Server. User has to enter all the attributes in the table.The entries are collected from the table to add. The execution time is calculated. The created entry will not be deleted after the test.

          2. Modify Test
            1. Inbuilt test :

              This will create a pre-defined entry first, then will modify the created entry in the LDAP Server.And calculate the execution time. After execution of the test, the created entry will be deleted from the LDAP Server.

            2. User defined test

              This will modify the entry in the LDAP Server. User has to enter all the attributes in the table. The entries are collected from the table to modify. The execution time is calculated. The entry will not be deleted from the LDAP Server.

          3. Search Test
            1. Inbuilt test :

              This will create the entry first, then will search if the attributes are available. It calculates the execution time of the search query. At the end of the execution,created entry will be deleted from the LDAP Server.

            2. User defined test

              This will search the user defined entry(Search filter) in the Search base (again, defined by the user). The entries should be available in the LDAP Server. The execution time is calculated.

          4. Delete Test
            1. Inbuilt test :

              This will create a pre-defined entry first, then it will be deleted from the LDAP Server. The execution time is calculated.

            2. User defined test

              This will delete the user-defined entry in the LDAP Server. The entries should be available in the LDAP Server. The execution time is calculated.
              有兩種方法可以創(chuàng)建測試用例測試LDAP服務(wù)器。
              內(nèi)置的測試用例。
              用戶定義的測試用例。
              有四個測試場景的測試LDAP。給出了測試如下:
              添加測試
              內(nèi)置的測試:
              這將添加一個預(yù)定義的條目在LDAP服務(wù)器和計算執(zhí)行時間。執(zhí)行測試后,創(chuàng)建的條目將被刪除從LDAP服務(wù)器。
              用戶定義的測試:
              這將在LDAP服務(wù)器中添加條目。用戶必須輸入表中所有的屬性。從表中收集到的條目添加計算執(zhí)行時間。創(chuàng)建的條目測試后將不會被刪除。
              修改測試
              內(nèi)置的測試:
              這將創(chuàng)建一個預(yù)定義的條目,然后將修改在LDAP服務(wù)器創(chuàng)建的條目。并計算執(zhí)行時間。執(zhí)行測試后,創(chuàng)建的條目將被刪除從LDAP服務(wù)器。
              用戶定義的測試
              這將修改LDAP服務(wù)器中的條目。用戶必須輸入表中所有的屬性。從表中收集修改的條目。計算執(zhí)行時間。條目不會從LDAP服務(wù)器中刪除。
              搜索測試
              內(nèi)置的測試:
              這將創(chuàng)建的條目,然后將搜索可用的屬性。它計算搜索查詢的執(zhí)行時間。結(jié)束時執(zhí)行,創(chuàng)建條目將被刪除從LDAP服務(wù)器。
              用戶定義的測試
              這將搜索用戶定義的條目(搜索過濾器)在搜索基地(再一次,由用戶定義的)。應(yīng)該在LDAP服務(wù)器中可用的條目。計算執(zhí)行時間。
              刪除測試
              內(nèi)置的測試:
              這將創(chuàng)建一個預(yù)定義的條目,然后它將從LDAP服務(wù)器中刪除。計算執(zhí)行時間。
              用戶定義的測試
              這將刪除用戶定義的條目在LDAP服務(wù)器。應(yīng)該在LDAP服務(wù)器中可用的條目。計算執(zhí)行時間。

          Parameters

          AttributeDescriptionRequired
          NameDescriptive name for this sampler that is shown in the tree.No
          Server Name or IPDomain name or IP address of the LDAP server. JMeter assumes the LDAP server is listening on the default port(389).Yes
          Portdefault port(389).Yes
          root DNDN for the server to communicateYes
          UsernameLDAP server username.Usually
          PasswordLDAP server password. (N.B. this is stored unencrypted in the test plan)Usually
          Entry DNthe name of the context to create or Modify; may not be empty Example: do you want to add cn=apache,ou=test you have to add in table name=cn, value=apacheYes
          Deletethe name of the context to Delete; may not be emptyYes
          Search basethe name of the context or object to searchYes
          Search filterthe filter expression to use for the search; may not be nullYes
          add testthis name, value pair to added in the given context objectYes
          modify testthis name, value pair to add or modify in the given context object






          jmeter random variable

          Control Panel

          Parameters

          AttributeDescriptionRequired
          NameDescriptive name for this element that is shown in the tree.Yes
          Variable NameThe name of the variable in which to store the random string.Yes
          Format StringThe java.text.DecimalFormat format string to be used. For example "000" which will generate numbers with at least 3 digits, or "USER_000" which will generate output of the form USER_nnn. If not specified, the default is to generate the number using Long.toString()No
          Minimum ValueThe minimum value (long) of the generated random number.Yes
          Maximum ValueThe maximum value (long) of the generated random number.Yes
          Random SeedThe seed for the random number generator. Default is the current time in milliseconds. If you use the same seed value with Per Thread set to true, you will get the same value for earch Thread as per Random class.No
          Per Thread(User)?If False, the generator is shared between all threads in the thread group. If True, then each thread has its own random generator.Yes

           


          18.4.13 TCP Sampler Config

          The TCP Sampler Config provides default data for the TCP Sampler

          Control Panel

          Parameters

          AttributeDescriptionRequired
          NameDescriptive name for this element that is shown in the tree.No
          TCPClient classnameName of the TCPClient class. Defaults to the property tcp.handler, failing that TCPClientImpl.No
          ServerName or IPName or IP of TCP serverNo
          Port NumberPort to be usedNo
          Re-use connectionIf selected, the connection is kept open. Otherwise it is closed when the data has been read.Yes
          Close connectionIf selected, the connection will be closed after running the sampler.Yes
          SO_LINGEREnable/disable SO_LINGER with the specified linger time in seconds when a socket is created. If you set "SO_LINGER" value as 0, you may prevent large numbers of sockets sitting around with a TIME_WAIT status.No
          End of line(EOL) byte valueByte value for end of line, set this to a value outside the range -128 to +127 to skip eol checking. You may set this in jmeter.properties file as well with eolByte property. If you set this in TCP Sampler Config and in jmeter.properties file at the same time, the setting value in the TCP Sampler Config will be used.No
          Connect TimeoutConnect Timeout (milliseconds, 0 disables).No
          Response TimeoutResponse Timeout (milliseconds, 0 disables).No
          Set NodelayShould the nodelay property be set?No
          Text to SendText to be sent


          Control Panel

           

          If you have more than one Thread Group, make sure you use different names for different values, as UDVs are shared between Thread Groups. Also, the variables are not available for use until after the element has been processed, so you cannot reference variables that are defined in the same element. You can reference variables defined in earlier UDVs or on the Test Plan.

           

          Parameters

          AttributeDescriptionRequired
          NameDescriptive name for this element that is shown in the tree.No
          User Defined VariablesVariable name/value pairs. The string under the "Name" column is what you'll need to place inside the brackets in ${...} constructs to use the variables later on. The whole ${...} will then be replaced by the string in the "Value" column.No

           


          18.4.10 Login Config Element

          The Login Config Element lets you add or override username and password settings in samplers that use username and password as part of their setup.

          Control Panel

          Parameters

          AttributeDescriptionRequired
          NameDescriptive name for this element that is shown in the tree.No
          UsernameThe default username to use.No
          PasswordThe default password to use. (N.B. this is stored unencrypted in the test plan)No


          18.4.17 Simple Config Element

          The Simple Config Element lets you add or override arbitrary values in samplers. You can choose the name of the value and the value itself. Although some adventurous users might find a use for this element, it's here primarily for developers as a basic GUI that they can use while developing new JMeter components.

          Control Panel

          Parameters

          AttributeDescriptionRequired
          NameDescriptive name for this element that is shown in the tree.Yes
          Parameter NameThe name of each parameter. These values are internal to JMeter's workings and are not generally documented. Only those familiar with the code will know these values.Yes
          Parameter ValueThe value to apply to that parameter.

          18.4.16 Counter

          Allows the user to create a counter that can be referenced anywhere in the Thread Group. The counter config lets the user configure a starting point, a maximum, and the increment. The counter will loop from the start to the max, and then start over with the start, continuing on like that until the test is ended.

          From version 2.1.2, the counter now uses a long to store the value, so the range is from -2^63 to 2^63-1.

          Control Panel

          Parameters

          AttributeDescriptionRequired
          NameDescriptive name for this element that is shown in the tree.No
          StartThe starting number for the counter. The counter will equal this number during the first iteration.Yes
          IncrementHow much to increment the counter by after each iteration.Yes
          MaximumIf the counter exceeds the maximum, then it is reset to the Start value. For versions after 2.2 the default is Long.MAX_VALUE (previously it was 0).No
          FormatOptional format, e.g. 000 will format as 001, 002 etc. This is passed to DecimalFormat, so any valid formats can be used. If there is a problem interpreting the format, then it is ignored. [The default format is generated using Long.toString()]No
          Reference NameThis controls how you refer to this value in other elements. Syntax is as in user-defined values $(reference_name} .Yes
          Track Counter Independently for each UserIn other words, is this a global counter, or does each user get their own counter? If unchecked, the counter is global (ie, user #1 will get value "1", and user #2 will get value "2" on the first iteration). If checked, each user has an independent counter.No
          Reset counter on each Thread Group IterationThis option is only available when counter is tracked per User, if checked, counter will be reset to Start value on each Thread Group iteration. This can be useful when Counter is inside a Loop Controller.No

           


           評論這張
           

          posted on 2014-02-28 13:49 順其自然EVO 閱讀(11009) 評論(0)  編輯  收藏 所屬分類: jmeter and badboy

          <2014年2月>
          2627282930311
          2345678
          9101112131415
          16171819202122
          2324252627281
          2345678

          導(dǎo)航

          統(tǒng)計

          常用鏈接

          留言簿(55)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 龙岩市| 库伦旗| 通渭县| 信丰县| 田林县| 高青县| 无棣县| 英德市| 延寿县| 高淳县| 施秉县| 石狮市| 体育| 鄂尔多斯市| 噶尔县| 大城县| 渝中区| 晋中市| 厦门市| 马山县| 泸定县| 刚察县| 育儿| 延庆县| 琼中| 西宁市| 三台县| 宁南县| 穆棱市| 斗六市| 蒲江县| 诸暨市| 肃北| 宁南县| 石林| 芦山县| 杭锦后旗| 德阳市| 罗源县| 崇仁县| 射洪县|