2 Solutions for analog IP testing [light and Shadow Portrait of Tokai Chen Guangjin Blog]

Source: Internet
Author: User

Background: Before encountering a labs daily requirement is a logical judgment for different IP address access, such as the IP of Hunan can be accessed, the IP address of other regions cannot access the application. Difficulty: When accessing the app during testing, the local address cannot be changed and always the same address. Requirements for different IP address segments cannot be tested Solution OneDebug code remotely using debug mode

Idea: Set breakpoints by locally initiating HTTP requests, connecting to a daily machine or a development machine. When the request arrives at the breakpoint, modify the IP address information to impersonate any IP address request. Processing results See return information

? Step one: Using the Eclipse Tool debug mode, connect the daily machine \ Development machine? Step two: Find the Java file of request processing in the development code, set the breakpoint to use the local IP address to access the page, initiate the request, such as Access http:// Www.daily.taobao.net step three: After initiating the request, modify the IP parameter value at the breakpoint, after modifying the value, continue to complete the debug operation, review the return scenario one of the advantages: no need to test script preparation, quick and easy, flexible data values can be arbitrarily modified. Compare the data preparation for quick test completion when the project is time-intensive. Scenario One drawback: after the project's daily test is completed, it is not convenient for later regression. Does each return need to be performed manually? ================================================================================================== Solutions TwoUse the test script test to modify the request's parameter ideas in the script: in the test script, modify the requested IP address parameters?

?

Action: Add remote port address information to the request of the test script

??? Public void setUp () throws Exception {

?????? HttpServletRequest? req? = new simplehttpservletrequest ();

?????? Setreferer ("http://www.taobao.com");

???? ??? Setremoteaddr ("100.100.100.100");????/* Set the client address */

?????? Setparameter ("Taobao_nick", "tbtest1061");

?????? Setsession ("Login", "true");

?????? Setsession ("_nk_", "tbtest1061");

?????? Setparameter ("Method", "Taobao.user.get");??????

??? } Scenario Two advantages: the completion of the script to facilitate the project's daily return to work. Scenario Two disadvantages: script preparation takes a long time, not suitable for project and daily tense to complete


It is said that men look at the United States map can prolong life, women to look at the United States map can beauty ...
So, where to look at the beautiful map? Honey, don't worry! In here---



Welcome attention! Light and Shadow Portrait of the public number!

Light and shadow portraits---and beauty.
(Portrait of a photographic art figure)
Copyright 2015 Lighting Technology Co., ltd All rights reserved

Reply 1: Home
Reply 2: Shadow Gallery
Reply 3: Community
Reply 4: Download app
Reply 5: Featured Articles List

Lightshadow Shadow portrait Abstract art macro Macro Animals Animal Nature natural black and white black-people portrait Celebrities Festival performing Arts line For Art City Urban Architecture building Sport Sport Commercial Commercial photography life Concert Street Family family transportation Fashion Fashion Travel Tour Film movie underwater underwater Fine Art Urban country exploration food gourmet wedding wedding journalism Uncategorized Miscellaneous Landscapes Landscape

2 solutions for analog IP testing [light and Shadow Portrait of Tokai Chen Guangjin Blog]

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.