Jmeter入門16 資料構造之隨機數Random Variable & __Random函數

來源:互聯網
上載者:User

標籤:9.png   src   mic   .com   固定   png   span   產生隨機數   div   

 介面測試有時參數使用隨機數構造。jmeter添加隨機數兩種方式

1  添加配置 》 Random Variable 

2  __Random函數   ${__Random(1000,9999)}

 

 

方式一 Random Variable 

 

 

 

方式二  __Random()函數

 

 

 

添加http請求,2個參數:訂單號,使用者分別是兩種方式產生的。

訂單號 = 日期+__Random函數產生隨機數

使用者名稱= 隨機變數輸出的固定格式隨機數

random_function    orderid_${__time(yyyyMMddHHmmss)}${__Random(1000,9999)}random_variable    ${rand}

 

 

添加結果樹,多運行幾次,查看產生的訂單號和使用者名稱

 

 

the end!

 

Jmeter入門16 資料構造之隨機數Random Variable & __Random函數

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.