Linux+jmeter+python base + Grab packet intercept

Source: Internet
Author: User
Tags type casting windows download

Linux

One configuration JDK environment

* Need to get root, or switch to root user

1.windows download Good, go to http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html Official website download jdk (linux corresponding version)

2. Create the Java path folder in the USR directory

"Root bin" cd/usr
mkdir Java

3. Place the jdk-8u60-linux-x64.tar.gz under the folder you just created

I use the CRT tool command line input RZ directly uploaded to the current directory

4. Unzip the JDK to the current directory

Decompression command TAR-ZXVF jdk-8u60-linux-x64.tar.gz
Get folder jdk1.8.0_60

5. Edit the configuration file, configure environment variables

Vi/etc/profile
Add the following: Java_home according to the actual directory to
Java_home=/usr/java/jdk1.8.0_60
Classpath= $JAVA _home/lib/
Path= $PATH: $JAVA _home/bin
Export PATH java_home CLASSPATH

Wq Save exit

6. Restart execution command: Source/etc/profile

7. Restart the computer after restarting the command

8. Enter Java-version to see if the JDK version was successfully installed

Two running jmeter under Linux

1. Establish a link to a Linux server or virtual machine via the CRT connection tool

2. Save the JMeter Script when window is set

3. Open CRT, command line enter RZ script, upload to Linux,jmeter script folder

4. Enter the command jmeter.sh-n-t script name. JMX-L (lowercase) results . JTL

Linux can only run. sh format files;

-N means no graphical operation;

-T represents the specified script;

-L indicates the specified result;

5. After the run is finished, bring the results. JTL to Windows, then open the JMeter aggregation report to view

Three Python basics

1. The code execution order is executed in one line, up and down

2. Explanatory language: Similar to reading a foreign language book translation, one line to compile the execution, read once again a line of translation to execute once

Compiled language, the whole number of translation good, to read, in the reading without the need for translation

3. Define variables; If it is an integer (int), float (float) definition does not need to be quoted as: name = 111

If it is a string (str) definition, it needs to be quoted as: name = "Jmy"

4. placeholder; If i = ' eat '

A=12

Print ("You want to dry ha%s"%i) or multiple print ("You want to dry ha%s%d"% (i,a))

Running results you're going to eat.

%s is a placeholder for the string type behind the%i is a defined variable

%d placeholder is an integer type

%.2f placeholder is a floating-point type

5. Type casting

such as name = input (' input name ') (input default type is string shape)

name = Int (name) cast to integral type

Writing code is very logical.

Requirements: Write a login program, the maximum number of failures is 3 times, input account, password error, prompt account/password error. Failed three times program exit, enter correct, prompt Welcome to XXX login.

Requirements analysis, the first maximum number of times is three, think of the loop three times, and then the account password, judge;

Implementation code

i = 3
While I:
I-=1
UserID = input (' Please enter user name ')
Password = input (' Please enter password ')
if UserID = = ' Jmy ' and password = = ' 123 ':
Print (' Login successful ')
Break
elif userid! = ' Jmy ':
Print (' User name input error, you also have%s chance '%i)
elif Password! = 123:
Print (' Password input error, you also have%s chance '% i)
Else:print (' Login failed ')

Problems encountered: 1. Input was not written to the loop at the beginning (input is a string type)

2. No break jumps out of the loop

3. Complex code

Iv. grasping packets and intercepting

1. The main tool to grab the bag is fiddler or Charles grab bag

2.

Linux+jmeter+python base + Grab packet intercept

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.