CN105550112A - Browser rendering capability test method - Google Patents

Browser rendering capability test method Download PDF

Info

Publication number
CN105550112A
CN105550112A CN201510954703.2A CN201510954703A CN105550112A CN 105550112 A CN105550112 A CN 105550112A CN 201510954703 A CN201510954703 A CN 201510954703A CN 105550112 A CN105550112 A CN 105550112A
Authority
CN
China
Prior art keywords
window
browser
function
information
measured
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510954703.2A
Other languages
Chinese (zh)
Inventor
王烨
柳晶
柳增寿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Haitai Fangyuan High Technology Co Ltd
Original Assignee
Beijing Haitai Fangyuan High Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Haitai Fangyuan High Technology Co Ltd filed Critical Beijing Haitai Fangyuan High Technology Co Ltd
Priority to CN201510954703.2A priority Critical patent/CN105550112A/en
Publication of CN105550112A publication Critical patent/CN105550112A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing

Abstract

The invention provides a browser rendering capability test method. The method comprises the steps of A, rendering a test webpage in a to-be-tested browser; B, obtaining window information of the to-be-tested browser through a window handle; and C, comparing the window information of the to-be-tested browser with window information of a reference browser to obtain a browser rendering capability test result. According to the method, the defects of an image capture mode adopted during browser rendering in the prior art are overcome, and all information of all windows in the to-be-tested browser is obtained through the window handle, so that a test process is more comprehensive and accurate.

Description

A kind of method of testing of browser renders ability
Technical field
The present invention relates to field of computer technology, particularly a kind of method of testing of browser renders ability.
Background technology
The test of existing browser renders ability is all that such as application number is 201210213735.3 by screenshotss technical limit spacing browser image, and name is called the earlier application of the method and apparatus of test browser.But in actual test process, because many html pages can not show by 100% full page, therefore may have Lou item and lacuna and cannot realize complete test.
Application number is 201410092857.0, name is called a kind of earlier application of browser testing method and apparatus, although solve the problems referred to above, but still be that the browser area that will test is carried out sectional drawing contrast, when having suspension window or other cascading windows, the rendering capability of browser cannot be judged according to sectional drawing, in addition, the minute differences of font and color to be also difficult to discover by naked eyes, the success ratio of which depends on the feature point detection of image and the accuracy rate of Graphic Pattern Matching algorithm.
Summary of the invention
In view of this, fundamental purpose of the present invention is, provides a kind of method of testing of browser renders ability, comprises step:
A, on browser to be measured to test webpage play up;
B, obtain the window information on browser to be measured by window handle;
C, the window information of described browser to be measured and benchmark browser to be contrasted, draw browser renders aptitude tests result.
By upper, overcome the defect adopting sectional drawing mode in prior art when carrying out browser renders, being obtained the full detail of all windows on browser to be measured by window handle, in test process, more comprehensively, accurately.
Optionally, step B comprises:
B1: enumerate each visible top-level windows on browser to be measured, obtains the information of each the visible top-level windows enumerated;
B2: judge whether to have enumerated, if terminate this step, otherwise returns step B1.
By upper, obtained the full detail of all top-level windows on browser to be measured by window handle, so that in follow-up test process, more comprehensively, accurately.
Optionally, step B1, B2 adopt and realize with minor function:
:: EnumWindows (reinterpret_castEnumWindowsProc, NULL), wherein, function EnumWindows is for enumerating all visible top-level windows on browser to be measured, send window handle to call back function, call back function returns FALSE and stopping is enumerated, otherwise EnumWindows function continues to enumerate top-level windows; Function EnumWindowsProc is call back function.
Optionally, also comprise after step B2:
B3: for the described top-level windows enumerated, using each top-level windows as parent window, enumerates all subwindows of each parent window;
B4: judge whether to have enumerated, if terminate this step, otherwise returns step B3.
By upper, when a top-level windows is as parent window, and when comprising some subwindows, the information of its all subwindow can be got equally, thus carry out playing up test, make test result more comprehensive.
Optionally, step B3, B4 adopt and realize with minor function:
EnumChildWindows (HWNDhWndParent, WNDENUMPROClpEnumFunc, LPARAMlParam), wherein, function EnumChildWindows is used for all subwindows enumerating current parent's window successively, and send window handle to call back function, call back function returns FALSE and stopping enumerated, otherwise EnumWindows function continues to enumerate, until all subwindows of each parent window have scanned; Function lpEnumFunc is call back function, is expressed as BOOLCALLBACKEnumChildProc (HWNDhwndChild, LPARAMlParam).
Optionally, step B also comprises:
B5: determine the window that user is selected by mouse, to obtain the step of this window information.
By upper, only wish some window of browser is carried out playing up test for likely there will be user, or due to some window that cannot to scan acquisition for special circumstances such as embedded wickets test time, the mode clicked by mouse can be adopted to obtain the information of some certain window.
Optionally, step B5 adopts and realizes with minor function: HWNDWindowFromPoint (POINTPoint), and this function is for obtaining the handle of the window comprising specified point; TypedefstructtagPOINT{LONGx; LONGy; , this function is for getting the information of specified point place window.
Optionally, step C comprises: the window information of described browser to be measured and benchmark browser is converted to binary data;
More described binary data, draws browser renders aptitude tests result according to comparative result.
Accompanying drawing explanation
Fig. 1 is process flow diagram of the present invention.
Embodiment
For overcoming the defect that prior art exists, the invention provides a kind of method of testing of browser renders ability, browser to be measured loads test webpage and plays up, then pass through operating system window API but not sectional drawing technical limit spacing current browser active window handle, and then obtain the message bit pattern in internal memory; The information obtained is saved as binary data and reference net page data contrasts; Show that the mistake of browser to be tested exports and rendering capability by comparison result.
As shown in Figure 1, the method for testing of browser renders ability of the present invention comprises the following steps:
S10: on browser to be measured, test webpage is played up.
S20: obtain all window informations on browser to be measured.
Enumerate all visible top-level windows on browser, and from the bottom collect and gather all visible top-level windows play up after information.
Concrete, employing united application EnumWindows, EnumWindowsProc, EnumChildWindows and EnumChildProc four groups of function handles realize above-mentioned functions.
First, call EnumWindows function, concrete function statement is::: EnumWindows (reinterpret_castEnumWindowsProc, NULL).Its functional representation is: import call back function into as first parameter, and first Parameter Switch is become WNDENUMPROC type, and when adjusting back parameter and returning FALSE, EnumWindows end-of-job, second parameter is set to NULL.Readjustment parameter is EnumWindowsProc function.
EnumWindows function is used for from desktop window (it is the ancestors of all windows), scans successively, to enumerate the top-level windows information on all screens, and sends window handle to call back function.This call back function is EnumWindowsProc function, only has when call back function returns FALSE, and EnumWindows function stops scanning, otherwise EnumWindows function continues scanning, until all top-level windows have scanned.
Secondly, for the top-level windows on all screens enumerated, using each top-level windows as parent window, all subwindows of each parent window are enumerated.
Call EnumChildWindows function, concrete function statement is: EnumChildWindows (HWNDhWndParent, WNDENUMPROClpEnumFunc, LPARAMlParam).The effect of this function: the subwindow to hWndParent calls lpEnumFunc function in order.The type function of lpEnumFunc is as follows: BOOLCALLBACKEnumChildProc (HWNDhwndChild, LPARAMlParam)
In EnumChildWindows function, parameters is as follows: HWNDhWndParent parent window handle; The address of WNDENUMPROClpEnumFunc call back function, call back function is EnumChildProc function; LPARAMlParam is self-defining parameter.
Only have when call back function returns FALSE, EnumChildWindows function stops scanning, otherwise EnumChildWindows function continues scanning, until all subwindows of each parent window have scanned.
Further, also comprise after this step: obtain the window that user is selected by mouse, to obtain the step of this window information.
In specific operation process, likely there will be user only to wish some window of browser is carried out playing up test, or the window that cannot scan acquisition due to some special circumstances in step S20 carries out testing (such as some embedded wicket).Based on this, the mode clicked by mouse can be adopted to obtain the information of some certain window.
After knowing that mouse is clicked target window by user, call WindowFromPoint function, the effect of this function obtains the handle comprising the window of specified point, and concrete function statement is: HWNDWindowFromPoint (POINTPoint).Parameter Point represents position that mouse the clicks coordinate relative to target window.
Then, adopt window handle obtain function obtain click the content of window.In the present embodiment, based on 32 environment of MicrosoftWindows operating system, adopt win32API window handle, be specially: typedefstructtagPOINT{LONGx; LONGy; POINT.Wherein, x, y represent horizontal stroke, the ordinate of mouse point respectively.Thus get the information that mouse clicks window.
Create class name array, scanned all window informations are stored in created class name array.
By upper, enumerate the top-level windows information on all screens, its principle be from the bottom collect and gather browser to be measured all play up after information, namely, enumerate all active display window internal codes, the special elements by Systematical control is quoted, as window, bitmap, icon, memory block, cursor, font, menu etc. by it.The incomplete defect of sectional drawing can be broken away from, with in subsequent step, test the rendering result of all windows.
S30: described window information and benchmark window information are carried out scale-of-two and contrasts to test.
First, the window information obtained by step S20 carries out Binary Conversion.Binary Conversion step adopts existing techniques in realizing, repeats no more.
Adopt same Binary Conversion technology, benchmark window information is carried out Binary Conversion, thus the window information obtained by step S20 and benchmark window information carry out scale-of-two contrast, thus draw the rendering capability of browser and the region of Rendering errors.
S40: generate test report.
Test result in step S30 is exported in a tabular form, generates test report, to inform user.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention.In a word, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (8)

1. a method of testing for browser renders ability, is characterized in that, comprises step:
A, on browser to be measured to test webpage play up;
B, obtain the window information on browser to be measured by window handle;
C, the window information of described browser to be measured and benchmark browser to be contrasted, draw browser renders aptitude tests result.
2. method according to claim 1, is characterized in that, step B comprises:
B1: enumerate each visible top-level windows on browser to be measured, obtains the information of each the visible top-level windows enumerated;
B2: judge whether to have enumerated, if terminate this step, otherwise returns step B1.
3. method according to claim 2, is characterized in that, step B1, B2 adopt and realize with minor function:
EnumWindows (reinterpret_castEnumWindowsProc, NULL), wherein, function EnumWindows is for enumerating all visible top-level windows on browser to be measured, send window handle to call back function, call back function returns FALSE and stopping is enumerated, otherwise EnumWindows function continues to enumerate top-level windows; Function EnumWindowsProc is call back function.
4. method according to claim 2, is characterized in that, also comprises after step B2:
B3: for the described top-level windows enumerated, using each top-level windows as parent window, enumerates all subwindows of each parent window;
B4: judge whether to have enumerated, if terminate this step, otherwise returns step B3.
5. method according to claim 4, is characterized in that, step B3, B4 adopt and realize with minor function:
EnumChildWindows (HWNDhWndParent, WNDENUMPROClpEnumFunc, LPARAMlParam), wherein, function EnumChildWindows is used for all subwindows enumerating current parent's window successively, and send window handle to call back function, call back function returns FALSE and stopping enumerated, otherwise EnumWindows function continues to enumerate, until all subwindows of each parent window have scanned; Function lpEnumFunc is call back function, is expressed as BOOLCALLBACKEnumChildProc (HWNDhwndChild, LPARAMlParam).
6. the method according to claim 2 or 4, is characterized in that, step B also comprises:
B5: determine the window that user is selected by mouse, to obtain the step of this window information.
7. method according to claim 6, is characterized in that, step B5 adopts and realizes with minor function: HWNDWindowFromPoint (POINTPoint), and this function is for obtaining the handle of the window comprising specified point; TypedefstructtagPOINT{LONGx; LONGy; , this function is for getting the information of specified point place window.
8. method according to claim 1, is characterized in that, step C comprises: the window information of described browser to be measured and benchmark browser is converted to binary data;
More described binary data, draws browser renders aptitude tests result according to comparative result.
CN201510954703.2A 2015-12-17 2015-12-17 Browser rendering capability test method Pending CN105550112A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510954703.2A CN105550112A (en) 2015-12-17 2015-12-17 Browser rendering capability test method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510954703.2A CN105550112A (en) 2015-12-17 2015-12-17 Browser rendering capability test method

Publications (1)

Publication Number Publication Date
CN105550112A true CN105550112A (en) 2016-05-04

Family

ID=55829306

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510954703.2A Pending CN105550112A (en) 2015-12-17 2015-12-17 Browser rendering capability test method

Country Status (1)

Country Link
CN (1) CN105550112A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106547547A (en) * 2016-10-18 2017-03-29 广州酷狗计算机科技有限公司 Collecting method and device
CN107665257A (en) * 2017-10-11 2018-02-06 成都知道创宇信息技术有限公司 Suspend method movable in the page during a kind of browser window switching
CN109446061A (en) * 2018-09-17 2019-03-08 平安科技(深圳)有限公司 A kind of page detection method, computer readable storage medium and terminal device
CN111813686A (en) * 2020-07-20 2020-10-23 腾讯科技(深圳)有限公司 Game testing method and device, testing terminal and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050177597A1 (en) * 2004-02-04 2005-08-11 Steve Elmer System and method of exercising a browser
CN103514090A (en) * 2012-06-26 2014-01-15 腾讯科技(深圳)有限公司 Method and device for testing browser
CN104424260A (en) * 2013-08-29 2015-03-18 腾讯科技(深圳)有限公司 Browser information sharing method and device
CN104978098A (en) * 2014-04-01 2015-10-14 深圳市驱动人生软件技术有限公司 Method and system for quickly changing wallpaper

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050177597A1 (en) * 2004-02-04 2005-08-11 Steve Elmer System and method of exercising a browser
CN103514090A (en) * 2012-06-26 2014-01-15 腾讯科技(深圳)有限公司 Method and device for testing browser
CN104424260A (en) * 2013-08-29 2015-03-18 腾讯科技(深圳)有限公司 Browser information sharing method and device
CN104978098A (en) * 2014-04-01 2015-10-14 深圳市驱动人生软件技术有限公司 Method and system for quickly changing wallpaper

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106547547A (en) * 2016-10-18 2017-03-29 广州酷狗计算机科技有限公司 Collecting method and device
CN106547547B (en) * 2016-10-18 2019-12-10 广州酷狗计算机科技有限公司 data acquisition method and device
CN107665257A (en) * 2017-10-11 2018-02-06 成都知道创宇信息技术有限公司 Suspend method movable in the page during a kind of browser window switching
CN109446061A (en) * 2018-09-17 2019-03-08 平安科技(深圳)有限公司 A kind of page detection method, computer readable storage medium and terminal device
CN109446061B (en) * 2018-09-17 2022-06-10 平安科技(深圳)有限公司 Page detection method, computer readable storage medium and terminal device
CN111813686A (en) * 2020-07-20 2020-10-23 腾讯科技(深圳)有限公司 Game testing method and device, testing terminal and storage medium

Similar Documents

Publication Publication Date Title
US20210390032A1 (en) Systems, methods and computer readable medium for visual software development quality assurance
CN104252410A (en) Method and equipment for testing control in page
CN110008110B (en) User interface testing method and device
CN105550112A (en) Browser rendering capability test method
JP5061104B2 (en) Web usage overlay for third-party web plug-in content
US9804955B2 (en) Method and apparatus for creating reference images for an automated test of software with a graphical user interface
US11194596B2 (en) Simulating human interface interaction resilient to user interface changes
CN112463580A (en) Test system and method based on virtualization device
CN104978739A (en) Image object selection method and apparatus
CN107707561B (en) Penetration testing method and device
CN105512043A (en) Test method and device
CN111290955B (en) Non-invasive automatic test system for subway signal system test software
CN103514090A (en) Method and device for testing browser
CN104820634A (en) Method and device for detecting page test track
CN108121648B (en) Interface error monitoring method
CN105354138A (en) Method for determining specific control attribute of mobile phone page
CN102866885B (en) Method and device for confirming clicking position in webpage
CN104820565A (en) Method and terminal for processing sliding operation instruction
CN112506778A (en) WEB user interface automatic test method, device, equipment and storage medium
CN111324845B (en) Method and system for constructing dial object
CN116719736A (en) Test case generation method and device for testing software interface
CN104808913A (en) Event responding method and device
US7941759B2 (en) Interactive analysis of network adjustment results
CN103678059A (en) Random key testing method and device
CN113900932A (en) Test script generation method, device, medium and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160504

RJ01 Rejection of invention patent application after publication