Automated Implementation of user experience testing-check the tab order

Source: Internet
Author: User

Note: This article was first published in the ninth part of 51 testing world

Check tab order

Using a method similar to checking focus, you can check whether the focus jump sequence between controls on the interface is correct, that is, the tab order check we usually call.

The purpose of checking the jump sequence of focus is to improve the efficiency of users. In the input-intensive user interface, users usually input data in most cases, if the keyboard Tab key and shortcut key are not well supported, it takes a lot of time to move the mouse and locate the mouse each time you enter a piece of data, which cannot effectively improve the efficiency of your work.

Pay attention to certain principles when checking the jump sequence of focus, such as "from top to bottom" and "from left to right. In addition, the arrangement of interface controls must follow similar principles. More importantly, you must consider the user's thinking mode during design, you can arrange the page layout and set the tab order of the controls in sequence by workflows and common data records in your business scenarios.

So how can we automatically check the tab order? In qtp, you can follow the control focus check method to determine whether to jump to the control by judging the focused attribute of the control. As shown in the following qtp script:

'Start the application

Systemutil. Run "C:/program files/Mercury Interactive/quicktest professional/samples/Flight/APP/flight 4A . EXE"

 

'Locate the program window and determine whether the default focus in the window is in the correct position

Dialog ("login"). Activate

Dialog ("login"). winedit ("agent name:"). checkproperty "focused", "true"

 

'Click the tab key on the control to check whether the focus is redirected to the correct position.

Dialog ("login"). winedit ("agent name:"). Type mictab

Dialog ("login"). winedit ("Password:"). checkproperty "focused", "true"

 

Dialog ("login"). winedit ("Password:"). Type mictab

Dialog ("login"). winbutton ("OK"). checkproperty "focused", "true"

 

Dialog ("login"). winbutton ("OK"). Type mictab

Dialog ("login"). winbutton ("cancel"). checkproperty "focused", "true"

 

Dialog ("login"). winbutton ("cancel"). Type mictab

Dialog ("login"). winbutton ("help"). checkproperty "focused", "true"

This script is used to check whether the tab jump order on the logon interface of the flight program shown in 3 is correct.


Figure 3 flight program logon page

Still use checkproperty to check the focused attribute, and then determine whether the attribute value is true. If it is true, it indicates that the current focus has correctly jumped to the control. After the check, a tab operation is executed, the method is to use the type method of the test object. The input parameter is mictab, and mictab is the built-in constant value of qtp, indicating to press the tab key.

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.