Winrunner debugging tips-breakpoint settings

Source: Internet
Author: User

Setting breakpoints is a feature that is often used in WR code writing and problem locating. I believe everyone should know this. The common method for setting breakpoints is to right-click the number of corresponding lines in the script, but here I will share several tips to help you complete debugging more conveniently.

In fact, wR has three breakpoint settings. They are: 1, at location 2, in function 3, and conditional. You can open the "breakpoints List" (debug-> breakpoints list) and click the Add button to view the interfaces for setting these breakpoints. The following describes the differences between the three breakpoints.

1. At location: Right-click to set the breakpoint method.You can add a breakpoint by setting the position of the breakpoint. The page contains a pass count, which indicates the number of times that the breakpoint is skipped. The default value is 0. For more information, see the following example:

1   i = 0;
2 j = 0;
3
4 for(i = 0;i < 10;i++)
5 {
6 * j = i;
7 }
* The position indicates the breakpoint position. If pass count is not set (that is, the default value is 0), the breakpoint is triggered every time a breakpoint is run. If pass count is set to 2, the breakpoint is triggered when I = 2, 5, and 8.

2. In function: triggers a breakpoint when a user-defined function is run.Triggered by a custom function name. The breakpoint location is the row defined by the function.Note that this function must be defined in the test script of the compiled module type (for example, the publicfunction in the automation framework and the function defined in myfunction) and loaded through load in advance.

3. Conditional: triggers a breakpoint through a preset condition.This method is useful. For example, you can set the condition to I> 5. When running to I = 6, 7, or 8, the breakpoint is triggered. The only problem with this type of breakpoint is that each line of code after the breakpoint is triggered will give a prompt, in fact, it can trigger the breakpoint and delete it, the annoying prompt will disappear immediately.Note that do not set conditions by assigning values (for example, I = 5). You must set breakpoints by using conditions (for example, I = 5 ).

Refer to all the above tipsMercury winrunner User's Guide.

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.