CN110532188A - The method and apparatus of page presentation test - Google Patents

The method and apparatus of page presentation test Download PDF

Info

Publication number
CN110532188A
CN110532188A CN201910814315.2A CN201910814315A CN110532188A CN 110532188 A CN110532188 A CN 110532188A CN 201910814315 A CN201910814315 A CN 201910814315A CN 110532188 A CN110532188 A CN 110532188A
Authority
CN
China
Prior art keywords
image
page
functional module
page image
target pages
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.)
Granted
Application number
CN201910814315.2A
Other languages
Chinese (zh)
Other versions
CN110532188B (en
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 Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online 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 Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN201910814315.2A priority Critical patent/CN110532188B/en
Publication of CN110532188A publication Critical patent/CN110532188A/en
Application granted granted Critical
Publication of CN110532188B publication Critical patent/CN110532188B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • 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
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0485Scrolling or panning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4038Image mosaicing, e.g. composing plane images from plane sub-images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/24Indexing scheme for image data processing or generation, in general involving graphical user interfaces [GUIs]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/32Indexing scheme for image data processing or generation, in general involving image mosaicing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Image Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

This application discloses a kind of methods of page presentation test, belong to automatization testing technique field.The described method includes: obtaining first page image and second page image, wherein the first page image and the second page image are the images of the target pages of the application program of different editions;By the first page image and the second page image, it is divided into multiple first functional module images and multiple second functional module images respectively;The multiple first functional module image and the multiple second functional module image are compared, comparing result is obtained.Using the application, the method that can effectively solve artificial observation in the related technology, so that the technical problem that the accuracy rate of test result is lower.

Description

The method and apparatus of page presentation test
Technical field
This application involves automatization testing technique fields, and in particular to a kind of method and apparatus of page presentation test.
Background technique
It needs to carry out regression test before new version APP (Application, application program) is online, i.e. test code Influence of the change to new version APP.Page presentation test is a part of regression test, page presentation test i.e. test new edition The page that this APP is shown has any change compared with the page that legacy version APP is shown, if has lacking for certain functional modules Deng.
Carrying out the method for page presentation test in the related technology is the displayed page and new edition of artificial observation legacy version APP The displayed page of this APP, and record the difference of the two.
During realizing the application, inventor find the relevant technologies the prior art has at least the following problems:
For the method for artificial observation, the small change of some displayed pages or the missing of functional module are easy tested Personnel omit, so that the accuracy rate of test result is lower.
Summary of the invention
The embodiment of the present application provides a kind of method and apparatus of page presentation test, can solve and exists in the related technology The technical issues of.The technical solution of the method and apparatus of the page presentation test is as follows:
In a first aspect, providing a kind of method of page presentation test, which comprises
Obtain first page image and second page image, wherein the first page image and the second page figure It seem the image of the target pages of the application program of different editions;
By the first page image and the second page image, be divided into respectively multiple first functional module images and Multiple second functional module images;
The multiple first functional module image and the multiple second functional module image are compared, compared As a result.
Optionally, the acquisition first page image and second page image, comprising:
The application program for installing and running different editions, the target pages for obtaining the application program of different editions are shown Show;
For the target pages of the application program of each version, repeatedly by target pages sliding pre-determined distance, and according to The secondary part shown to the target pages carries out screenshotss processing, obtains multiple first page image segments of the target pages Or multiple second page image segments, if sliding number reaches preset threshold or has slid into the bottom of the target pages, Then stop the processing of target pages sliding pre-determined distance;
Splicing is carried out respectively to the multiple first page image segments and the multiple second page image segments, Obtain first page image and second page image.
Optionally, the acquisition first page image and second page image, comprising:
Control script is sent to measured terminal, the control script is executed for controlling the measured terminal: being installed and is transported The application program of row different editions, the target pages for obtaining the application program of different editions are shown;For each version The target pages are repeatedly slided pre-determined distance by the target pages of application program, and successively the target pages are shown Part carry out screenshotss processing, obtain the target pages multiple first page image segments or multiple second page image sheets Section stops if sliding number reaches preset threshold or slid into the bottom of the target pages by the target pages Slide the processing of pre-determined distance;Return to the multiple first page image segments and the multiple second pressure surface image segments;
When the multiple first page image segments and the multiple second pressure surface for receiving the measured terminal return When image segments, stitching portion is carried out respectively to the multiple first page image segments and the multiple second page image segments Reason, obtains first page image and second page image.
Optionally, described to the multiple first page image segments and the multiple second page image segments, respectively Splicing is carried out, first page image and second page image are obtained, comprising:
Duplicate removal processing is carried out respectively to the multiple first page image segments and the multiple second page image segments, By after duplicate removal processing multiple first page image segments and multiple second page image segments carry out splicing respectively, obtain The first page image and the second page image.
Optionally, described by the first page image and the second page image, it is divided into multiple first function respectively Energy module image and multiple second functional module images, comprising:
Determine the type of the target pages, wherein the type includes H5 page type and primary page type, described Cut-off rule, the primary classes of pages are provided between multiple functional module images in the page-images of the page of H5 page type Grayscale bar is provided between multiple functional module images in the page-images of the page of type;
If the target pages belong to H5 page type, it is based on the first page image and the second page figure The first page image and the second page image are divided into multiple first functional modules by the cut-off rule as in respectively Image and multiple second functional module images;
If the target pages belong to primary page type, it is based on the first page image and the second page The first page image and the second page image are divided into multiple first function moulds by the grayscale bar in image respectively Block image and multiple second functional module images.
Optionally, described by the multiple first functional module image and the multiple second functional module image, it carries out Comparison obtains comparing result, comprising:
For each first functional module image, by the first functional module image respectively with each second functional module Image compares, and obtains multiple similarity thresholds, if the multiple similarity threshold is respectively less than default similarity threshold, Determine that the first functional module image is newly-increased functional module image;
If the maximum similarity threshold value in the multiple similarity threshold is greater than the default similarity threshold, it is determined that The corresponding second functional module image of the maximum similarity threshold value matches with the first functional module image, will match The first functional module image and the second functional module image carry out Detail contrast, obtain difference region location information.
Optionally, the first functional module image that will be matched and the second functional module image carry out Detail contrast, Obtain the location information in difference region, comprising:
Pixel value is carried out to the first functional module image to match and the second functional module image to make the difference to obtain area Other image carries out corrosion treatment and expansion process to the difference image;
Based on pixel value, the location information in region is distinguished in the difference image after determining corrosion treatment and expansion process.
Optionally, after the location information for obtaining difference region, further includes:
Based on the location information in the difference region, in the first functional module image and/or the second function mould to match In block image, the difference region is marked.
Optionally, the method also includes:
Based on the comparing result and examining report template, examining report is generated.
Second aspect, provides a kind of device of page presentation test, and described device includes:
Module is obtained, for obtaining first page image and second page image, wherein the first page image and institute State the image of the target pages for the application program that second page image is different editions;
Divide module, for being divided into multiple first respectively for the first page image and the second page image Functional module image and multiple second functional module images;
Contrast module, for carrying out the multiple first functional module image and the multiple second functional module image Comparison, obtains comparing result.
Optionally, the acquisition module, is used for:
The application program for installing and running different editions, the target pages for obtaining the application program of different editions are shown Show;
For the target pages of the application program of each version, repeatedly by target pages sliding pre-determined distance, and according to The secondary part shown to the target pages carries out screenshotss processing, obtains multiple first page image segments of the target pages Or multiple second page image segments, if sliding number reaches preset threshold or has slid into the bottom of the target pages, Then stop the processing of target pages sliding pre-determined distance;
Splicing is carried out respectively to the multiple first page image segments and the multiple second page image segments, Obtain first page image and second page image.
Optionally, the acquisition module, is used for:
Control script is sent to measured terminal, the control script is executed for controlling the measured terminal: being installed and is transported The application program of row different editions, the target pages for obtaining the application program of different editions are shown;For each version The target pages are repeatedly slided pre-determined distance by the target pages of application program, and successively the target pages are shown Part carry out screenshotss processing, obtain the target pages multiple first page image segments or multiple second page image sheets Section stops if sliding number reaches preset threshold or slid into the bottom of the target pages by the target pages Slide the processing of pre-determined distance;Return to the multiple first page image segments and the multiple second pressure surface image segments;
When the multiple first page image segments and the multiple second pressure surface for receiving the measured terminal return When image segments, stitching portion is carried out respectively to the multiple first page image segments and the multiple second page image segments Reason, obtains first page image and second page image.
Optionally, the acquisition module, is used for:
Duplicate removal processing is carried out respectively to the multiple first page image segments and the multiple second page image segments, By after duplicate removal processing multiple first page image segments and multiple second page image segments carry out splicing respectively, obtain The first page image and the second page image.
Optionally, the segmentation module, is used for:
Determine the type of the target pages, wherein the type includes H5 page type and primary page type, described Cut-off rule, the primary classes of pages are provided between multiple functional module images in the page-images of the page of H5 page type Grayscale bar is provided between multiple functional module images in the page-images of the page of type;
If the target pages belong to H5 page type, it is based on the first page image and the second page figure The first page image and the second page image are divided into multiple first functional modules by the cut-off rule as in respectively Image and multiple second functional module images;
If the target pages belong to primary page type, it is based on the first page image and the second page The first page image and the second page image are divided into multiple first function moulds by the grayscale bar in image respectively Block image and multiple second functional module images.
Optionally, the contrast module, is used for:
For each first functional module image, by the first functional module image respectively with each second functional module Image compares, and obtains multiple similarity thresholds, if the multiple similarity threshold is respectively less than default similarity threshold, Determine that the first functional module image is newly-increased functional module image;
If the maximum similarity threshold value in the multiple similarity threshold is greater than the default similarity threshold, it is determined that The corresponding second functional module image of the maximum similarity threshold value matches with the first functional module image, will match The first functional module image and the second functional module image carry out Detail contrast, obtain difference region location information.
Optionally, the contrast module, is used for:
Pixel value is carried out to the first functional module image to match and the second functional module image to make the difference to obtain area Other image carries out corrosion treatment and expansion process to the difference image;
Based on pixel value, the location information in region is distinguished in the difference image after determining corrosion treatment and expansion process.
Optionally, described device further includes mark module, is used for:
Based on the location information in the difference region, in the first functional module image and/or the second function mould to match In block image, the difference region is marked.
Optionally, described device further includes generation module, is used for:
Based on the comparing result and examining report template, examining report is generated.
The third aspect provides a kind of terminal, and the terminal includes processor and memory, is stored in the memory At least one instruction, at least one instruction are loaded by the processor and are executed to realize the page as described in relation to the first aspect The method for showing test.
Fourth aspect provides a kind of computer readable storage medium, is stored in the computer readable storage medium At least one instruction, at least one instruction are loaded by processor and are executed to realize page presentation as described in relation to the first aspect The method of test.
Technical solution bring beneficial effect provided by the embodiments of the present application includes at least:
The method of page presentation test provided by the embodiments of the present application, firstly, obtaining first page image and second page Image.Then, by first page image and second page image, it is divided into multiple first functional module images and multiple respectively Two functional module images.Finally, multiple first functional module images and multiple second functional module images are compared, obtain Comparing result.Therefore, the method for page presentation test provided by the embodiments of the present application, does not need the exhibition of artificial observation different editions Show the difference of the page, but compares automatically, thus, the small change of some displayed pages or lacking for functional module, also not It is easy to omit, so that the accuracy rate of test result is higher.
Detailed description of the invention
In order to more clearly explain the technical solutions in the embodiments of the present application, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, the drawings in the following description are only some examples of the present application, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.
Fig. 1 is a kind of flow chart of the method for page presentation test provided by the embodiments of the present application;
Fig. 2 is a kind of structural schematic diagram of the device of page presentation test provided by the embodiments of the present application;
Fig. 3 is a kind of structural schematic diagram of terminal provided by the embodiments of the present application;
Fig. 4 is a kind of application program target pages address administration surface chart provided by the embodiments of the present application;
Fig. 5 is the flow chart of a kind of screenshotss provided by the embodiments of the present application, duplicate removal and splicing;
Fig. 6 is a kind of target pages figure of application program provided by the embodiments of the present application;
Fig. 7 is a kind of the first functional module image and the second functional module image to match provided by the embodiments of the present application Contrast schematic diagram.
Specific embodiment
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with attached drawing to the application embodiment party Formula is described in further detail.
The embodiment of the present application provides a kind of method of page presentation test, and this method can be realized by terminal.Wherein, should It is the mobile terminals such as mobile phone, tablet computer, notebook that terminal, which can be, is also possible to the fixed terminals such as desktop computer.Specifically , method provided by the embodiments of the present application can be realized by test platform, can also be real with test platform and measured terminal It is existing, wherein the application program in need for carrying out page presentation test to be installed, test platform is tested whole for controlling in measured terminal End, test platform are a terminal device.
The embodiment of the present application provides a kind of method of page presentation test, and this method can be used for testing different editions Whether there is or not differences for the page that APP is shown.Firstly, obtaining the first page image of the application program of first version, and obtain the second edition The second page image of this application program.Then, by first page image and second page image, it is divided into multiple respectively One functional module image and multiple second functional module images.Finally, by multiple first functional module images and multiple second function Energy module image compares, and comparing result can be obtained.
As shown in Figure 1, the process flow of the method for page presentation test may include steps of:
In a step 101, first page image and second page image are obtained.
Wherein, first page image and second page image are the images of the target pages of the application program of different editions. Specifically, first page image can be able to be for the image of the target pages of the application program of new version, second page image The image of the target pages of the application program of legacy version.It is also possible that first page image is the mesh of the application program of ios release The image of the page is marked, second page image is the image of the target pages of the application program of Android version.
In an implementation, first page image and second page image manually can be obtained and be stored by tester, Then, test platform can obtain pre-stored first page image and second page image.
First page image and second page image can also be through automatic screenshot and splice acquisition, specifically, can To be divided into following two situation:
The first situation needs the application program for carrying out page presentation test to be mounted on test platform, then referring to Fig. 5 The specific steps for obtaining first page image and second page image can be individually performed by test platform.Corresponding treatment process Can be as described below, the application program of different editions is installed and run to test platform, obtains the mesh of the application program of different editions The mark page is shown.For the target pages of the application program of each version, target pages are repeatedly slided into pre-determined distance, and Screenshotss processing successively is carried out to the part that target pages are shown, obtains multiple first page image segments or multiple of target pages Second page image segments stop if sliding number reaches preset threshold or slid into the bottom of target pages by mesh Mark the processing of page sliding pre-determined distance.Multiple first page image segments and multiple second page image segments are carried out respectively Splicing obtains first page image and second page image.
Wherein, first page image can for first version application program target pages complete long image, second Page-images can be the complete long image of the target pages of the application program of the second edition.
In an implementation, firstly, tester's application program of typing first version and the second edition in test platform The information of target pages, wherein as shown in figure 4, the information includes at least the storage location information of target pages, can also include Number, team information, version information, platform information and name information of target pages etc..
Then, test platform downloads the application program of installation first version, and the first version based on preparatory typing automatically Application program target pages storage location information, automatically grab all target pages of the application program of first version simultaneously Successively shown.For each target pages, target pages are repeatedly slided into pre-determined distance, and successively show to target pages Part carry out screenshotss processing, until slide into the bottoms of target pages, thus, obtain multiple first pages of the target pages Image segments.In some cases, bottom is not present in target pages, for example, can glide always the page for microblogging, To constantly obtain new content.Therefore, when sliding number reaches preset threshold, should stop sliding, to avoid waste meter Calculation machine resource.Above-mentioned processing is carried out to all target pages of the application program of first version, all page objects can be obtained Multiple first page image segments in face.
Then, test platform can unload the application program of first version automatically, and the second edition is installed in downloading automatically Application program, and the storage location information of the target pages of the application program of the second edition based on preparatory typing, automatically grab All target pages of the application program of the second edition are successively shown.For each target pages, repeatedly by target pages Pre-determined distance is slided, and screenshotss processing successively is carried out to the part that target pages are shown, until the bottom of target pages is slid into, To obtain multiple second page image segments of the target pages.In some cases, bottom, example is not present in target pages Such as, for microblogging, can glide always the page, to constantly obtain new content.Therefore, when sliding number reaches default When threshold value, it should stop sliding, to avoid waste computer resource.It is equal to all target pages of the application program of the second edition Above-mentioned processing is carried out, multiple second page image segments of all target pages can be obtained.
Finally, for multiple first page images of first version and the same target page of the application program of the second edition Segment and multiple second page image segments carry out splicing respectively, and first page image and second page figure can be obtained Picture.
Second situation needs the application program for carrying out page presentation test to be mounted on measured terminal referring to Fig. 5, by Test platform and measured terminal cooperation obtain first page image and second page image, then corresponding treatment process can be as follows Described, test platform sends control script to measured terminal, and control script is for controlling measured terminal execution: installing and runs not With the application program of version, the target pages for obtaining the application program of different editions are shown;Application for each version Target pages are repeatedly slided pre-determined distance by the target pages of program, and successively carry out screenshotss to the part that target pages are shown Processing, obtains the multiple first page image segments or multiple second page image segments of target pages, if sliding number reaches To preset threshold or the bottoms of target pages has been slid into, then has been stopped the processing of target pages sliding pre-determined distance;It returns more A first page image segments and multiple second pressure surface image segments.Test platform is when receiving multiple the of measured terminal return When one page image segments and multiple second pressure surface image segments, to multiple first page image segments and multiple second page figures Photo section carries out splicing respectively, obtains first page image and second page image.
Wherein, first page image can for first version application program target pages complete long image, second Page-images can be the complete long image of the target pages of the application program of the second edition.
The application program in need for carrying out page presentation test is installed, measured terminal and test platform are established in measured terminal There are wireless connection or wired connection.
In an implementation, firstly, tester's application program of typing first version and the second edition in test platform The information of target pages, wherein as shown in figure 4, the information includes at least the storage location information of target pages, can also include Number, team information, version information, platform information and name information of target pages etc..
Then, test platform sends control script to measured terminal, carries out screenshotss processing to control measured terminal.Specifically , after measured terminal receives control script, measured terminal is based on control script, the application of automatic downloading installation first version Program, and the storage location information of the target pages of the application program of the first version based on preparatory typing, automatically grab first All target pages of the application program of version are successively shown on measured terminal.For each target pages, test is flat Target pages are repeatedly slided pre-determined distance by platform control measured terminal, and are successively carried out at screenshotss to the part that target pages are shown Reason, until the bottom of target pages is slid into, thus, obtain multiple first page image segments of the target pages.Certain In the case of, bottom is not present in target pages, for example, can glide always the page for microblogging, to constantly obtain newly Content.Therefore, when sliding number reaches preset threshold, should stop sliding, to avoid waste computer resource.To the first edition All target pages of this application program carry out above-mentioned processing, and multiple first page figures of all target pages can be obtained Photo section.
Then, under the control of test platform, measured terminal can unload the application program of first version automatically, and automatic The application program of the downloading installation second edition, and the position of the target pages of the application program of the second edition based on preparatory typing Information, all target pages for automatically grabbing the application program of the second edition are successively shown on measured terminal.For every Target pages are repeatedly slided pre-determined distance by a target pages, test platform control measured terminal, and successively aobvious to target pages The part shown carries out screenshotss processing, until the bottom of target pages is slid into, thus, obtain multiple first pages of the target pages Face image segments.In some cases, bottom is not present in target pages, for example, can glide always page for microblogging Face, to constantly obtain new content.Therefore, when sliding number reaches preset threshold, should stop sliding, to avoid waste Computer resource.Above-mentioned processing is carried out to all target pages of the application program of the second edition, all targets can be obtained Multiple second page image segments of the page.Later, measured terminal can unload the application program of the second edition.
That is, the application journey that the above process controls measured terminal downloading by test platform, installs and uninstalls different editions Sequence, and control measured terminal and show multiple target pages, simulate whole processes of the application program of user's operation different editions.
Finally, multiple first page image segments and multiple second page images that measured terminal will acquire are sent to test Platform.Test platform receive measured terminal transmission multiple first page image segments and multiple second page image segments it Afterwards, multiple first page image segments of the target pages of the application program of first version are carried out splicing by test platform, First page image can be obtained;Multiple second page image segments of the target pages of the application program of the second edition are carried out Second page image can be obtained in splicing.
It should be noted that test platform is based on TestNGjar packet in above-mentioned treatment process, keep measured terminal automatic Install and uninstall the application program of first version and the second edition.Test platform can control quilt by the driving interface of Appium It surveys terminal and carries out screenshotss.Test platform can obtain all targets based on Jenkins and Appium open source automation tools automatically The page is shown on measured terminal.
Optionally, referring to Fig. 5, in order to enable first page image and second page image that splicing obtains are more accurate, It is equal when in above-mentioned two situations to multiple first page image segments and multiple second page image segments progress splicing Duplicate removal processing can be carried out, corresponding treatment process can be as described below, to multiple first page image segments and multiple second Page-images segment carries out duplicate removal processing respectively, by the multiple first page image segments and multiple second pages after duplicate removal processing Image segments carry out splicing respectively, obtain first page image and second page image.
It in an implementation, include duplicate part in the two neighboring page-images segment intercepted sometimes, at this time if directly Splicing is carried out, then can make spliced first page image or second page image includes duplicate part, is unfavorable for Subsequent dividing processing is also unfavorable for subsequent comparison processing.Therefore, it is necessary to will repeat in two adjacent page-images segments Part carry out duplicate removal processing, can will be in two adjacent page-images segments in any page image segments when duplicate removal Repeating part weeds out, and retains the repeating part in another page-images segment, to avoid the two neighboring page Repeating part in image segments all weeds out, and causes the first page image being spliced into or second page image imperfect.
When carrying out duplicate removal processing, it is possible, firstly, to which the pixel value based on each pixel, identifies two neighboring page-images Duplicate part in segment, then, the location information based on pixel determines repeating part in an at least page-images segment In position, and the position based on repeating part eliminates the repeating part in the page-images segment.Finally, Splicing is carried out to page-images segment.When splicing, each page-images segment head and the tail are successively spliced.
It should be noted that page-images segment mentioned above is first page image segments or second page image sheet Section.
After splicing obtains first page image and second page image, the processing of step 102 can be carried out.
In a step 102, by first page image and second page image, it is divided into multiple first functional block diagrams respectively Picture and multiple second functional module images.
Wherein, functional block diagram seems the corresponding image of content for referring to same theme in first page image, for example, Fig. 6 Shown in microblogging application program, the corresponding image of content of each user's publication is a functional module image.
For example, the corresponding image of content of each user's publication is a functional block diagram for the page-images of microblogging Picture is often provided with boundary sign between different function module image, and optionally, boundary mark can be cut-off rule, can also Think grayscale bar.
In an implementation, the line of demarcation of functional module image each in page-images can be marked by artificial mode Note, then, page-images can be divided into multiple functional module images by the line of demarcation marked by test platform.
Optionally, page-images can also be divided into according to the grayscale bar or cut-off rule itself having in page-images Multiple functional module images.Correspondingly, the corresponding treatment process of step 102 can be as described below, the type of target pages is determined, Wherein, the type of target pages includes H5 page type and primary page type, in the page-images of the page of H5 page type Multiple functional module images between be provided with cut-off rule, multiple function moulds in the page-images of the page of primary page type Grayscale bar is provided between block image.If target pages belong to H5 page type, it is based on first page image and second page First page image and second page image are divided into multiple first functional module images by the cut-off rule in the image of face respectively With multiple second functional module images.If target pages belong to primary page type, it is based on first page image and second First page image and second page image are divided into multiple first functional block diagrams by the grayscale bar in page-images respectively Picture and multiple second functional module images.
Wherein, the H5 page refers to the page made using html5.The primary page, which refers to, can directly run on current behaviour Make the page of systematic difference program namely the page of native program, is referred to as the native page.
It in an implementation, can be based on before in the storage location information of the target pages of test platform typing, to judge mesh The type of the page is marked, that is, the type of target pages is different, the form of expression of the storage location information of target pages has very big Difference.It, can be according to the concrete type of target pages, to determine the segmentation of page-images after the type for determining target pages Mode.
When target pages belong to primary page type, as shown in fig. 6, due in the page-images of primary page type It is provided with grayscale bar between multiple functional module images, then page-images can be split based on grayscale bar.Specifically, can To be identified by pixel, determines the location information of grayscale bar, may then based on the location information of grayscale bar, by page-images It is split.When segmentation, grayscale bar can be rejected, i.e., not include grayscale bar in any functional module image.
When target pages belong to H5 page type, due to multiple functional block diagrams in the page-images of H5 page type It is provided with cut-off rule as between, then page-images can be split based on cut-off rule.Specifically, can be known by pixel Not, the location information for determining cut-off rule may then based on the location information of cut-off rule, page-images be split.
It should be noted that page-images mentioned above be first page image or second page image, it is mentioned above Functional module image be the first functional module image or the second functional module image.
It is multiple first functional module images by first page image segmentation, and is multiple the by second page image segmentation After two functional module images, the processing of step 103 can be carried out.
In step 103, multiple first functional module images and multiple second functional module images are compared, is obtained Comparing result.
In an implementation, when the quantity of the functional module image of the application program of different editions is consistent, and matches one by one, Multiple first functional module images and multiple second functional module images can successively be compared, thus, obtain comparing result.
Optionally, if multiple first functional module images are different with the quantity of multiple second functional module images, alternatively, It is not that can first determine the first functional module image and the second functional module image to match, then when matching one by one Detail contrast is carried out to the first functional module image to match and the second functional module image again, then step 103 is located accordingly Reason process can be as described below, for each first functional module image, by the first functional module image respectively with each Two functional module images compare, and obtain multiple similarity thresholds, if multiple similarity thresholds are respectively less than default similarity Threshold value, it is determined that the first functional module image is newly-increased functional module image.If the maximum phase in multiple similarity thresholds Be greater than default similarity threshold like degree threshold value, it is determined that the corresponding second functional module image of the maximum similarity threshold value and this One functional module image matches, and the first functional module image to match and the second functional module image are carried out details pair Than obtaining the location information in difference region.
In an implementation, when comparison, for each first functional module image, by the first functional module image and each the Two functional module images compare (namely to be gone to traverse the second all functional block diagrams with the first functional module image Picture), and obtain multiple similarity thresholds.If obtained multiple similarity thresholds are respectively less than default similarity threshold, illustrate First functional module image is newly-increased functional module image, namely there is no second to match with the first functional module image Functional module image, at this point, Detail contrast should not be carried out for the first functional module image and any second functional module image; If maximum similarity threshold value in obtained multiple similarity thresholds is greater than default similarity threshold, illustrate to exist with this The second functional module image that one functional module image matches, and by corresponding second functional block diagram of maximum similarity threshold value As being determined as the second functional module image to match with the first functional module image.
Above-mentioned processing is carried out to the first all functional module images, the first newly-increased functional module image can be obtained With the first functional module image and the second functional module image to match.It later, can be to the first functional module to match Image and the second functional module image carry out Detail contrast, to obtain the location information in difference region.
Comparing result may include the first newly-increased functional module image, the first functional module image respectively to match and Two functional module image groups and the location information for distinguishing region.
It should be noted that above-mentioned can make when comparing the first functional module image and the second functional module image With fuzzy matching algorithm, fuzzy matching algorithm can also be known as local matching algorithm, and the inspection of FAST characteristic point specifically can be used Method of determining and calculating.
Optionally, the specific of Detail contrast is carried out to the first functional module image to match and the second functional module image Process can be as follows, carries out pixel value to the first functional module image to match and the second functional module image and makes the difference place Reason obtains difference image, carries out corrosion treatment and expansion process to difference image.Based on pixel value, corrosion treatment and expansion are determined The location information in region is distinguished in difference image that treated.
Wherein, the location information for distinguishing region may include the location information for distinguishing each pixel in region, specifically It can be the coordinate value of each pixel, also may include the location information for distinguishing the external block diagram of minimum in region, specifically may be used Think the coordinate value on the vertex of minimum external block diagram.
In an implementation, it is done by carrying out pixel value to the first functional module image to match and the second functional module image Difference processing can remove (the not changed portion i.e. in functional module image of identical part in two functional module images Point), to obtain difference image.Then, corrosion treatment is carried out to difference image, so that noise is strengthened and removed to darkness, then Then, expansion process is carried out to difference image, thus prominent different pixels point.Finally, the pixel value based on pixel determines area The location information in other region.
In above-mentioned pixel value makes the difference, the pixel value that can be each pixel of the first functional module image subtracts The pixel value of each pixel of two functional module images, the pixel value for being also possible to each pixel of the second functional module image subtract The pixel value of each pixel of the first functional module image is removed, the application does not limit this.
Optionally, difference zone marker can also be come out, then corresponding treatment process can be as described below, based on difference The location information in region marks difference area in the first functional module image and/or the second functional module image to match Domain.
In an implementation, it after the location information for obtaining difference region, can will be distinguished based on the location information in difference region Zone marker comes out.For example, when location information includes the coordinate value on the vertex of the external block diagram of minimum for distinguishing region, Ke Yigen According to the coordinate value on the vertex of minimum external block diagram, the external block diagram of minimum for distinguishing region is drawn out.
When marked differential region, it can only remember in the acceptance of the bid of the first functional module image and distinguish region out, it can also be only Remember in the acceptance of the bid of the second functional module image and distinguishes region out, it can also be in the first functional module image and the second functional module image In mark difference region.In one possible implementation, difference region can be marked with rectangle frame or circular frame, Region is distinguished as shown in fig. 7, can also be come out with arrow mark.
Due to being marked to difference region, so the first functional module image to match and the second function to match Fine distinction can be caught in energy module image, to increase the accuracy of page presentation test.
Optionally, examining report can also be generated, then corresponding treatment process can be as follows, based on comparing result and Examining report template generates examining report.
In an implementation, examining report template can be that Templated file can be by comparing result when generating examining report It is directly filled into the corresponding position of examining report template, that is, produces examining report.
The method of page presentation test provided by the embodiments of the present application, firstly, obtaining first page image and second page Image.Then, by first page image and second page image, it is divided into multiple first functional module images and multiple respectively Two functional module images.Finally, multiple first functional module images and multiple second functional module images are compared, obtain Comparing result.Therefore, the method for page presentation test provided by the embodiments of the present application, does not need the exhibition of artificial observation different editions Show the difference of the page, but compares automatically, thus, the small change of some displayed pages or lacking for functional module, also not It is easy to omit, so that the accuracy rate of test result is higher.Also, decrease the cost of labor of tester.
Based on the same technical idea, the embodiment of the present application also provides a kind of device of page presentation test, the devices It can be the terminal in above-described embodiment, as shown in Fig. 2, the device includes:
Module 201 is obtained, for obtaining first page image and second page image, wherein first page image and the Two page-images are the images of the target pages of the application program of different editions;
Divide module 202, for being divided into multiple first function moulds respectively for first page image and second page image Block image and multiple second functional module images;
Contrast module 203, for multiple first functional module images and multiple second functional module images to be compared, Obtain comparing result.
Optionally, module 201 is obtained, is used for:
The application program for installing and running different editions, the target pages for obtaining the application program of different editions are shown Show;
For the target pages of the application program of each version, target pages are repeatedly slided into pre-determined distance, and successively right Part that target pages are shown carries out screenshotss processing, obtain target pages multiple first page image segments or multiple second pages Face image segments stop if sliding number reaches preset threshold or slid into the bottom of target pages by target pages Slide the processing of pre-determined distance;
Splicing is carried out to multiple first page image segments and multiple second page image segments respectively, obtains first Page-images and second page image.
Optionally, module 201 is obtained, is used for:
Control script is sent to measured terminal, control script is for controlling measured terminal execution: installing and runs different versions This application program, the target pages for obtaining the application program of different editions are shown;For the application program of each version Target pages, the part that target pages are repeatedly slided pre-determined distance, and are successively shown to target pages carries out screenshotss processing, The multiple first page image segments or multiple second page image segments of target pages are obtained, if sliding number reaches default Threshold value or the bottom for having slid into target pages then stop the processing of target pages sliding pre-determined distance;Return to multiple first Page-images segment and multiple second pressure surface image segments;
It is right when receiving the multiple first page image segments and multiple second pressure surface image segments of measured terminal return Multiple first page image segments and multiple second page image segments carry out splicing respectively, obtain first page image and Second page image.
Optionally, module 201 is obtained, is used for:
Duplicate removal processing is carried out respectively to multiple first page image segments and multiple second page image segments, at duplicate removal Multiple first page image segments and multiple second page image segments after reason carry out splicing respectively, obtain first page Image and second page image.
Optionally, divide module 202, be used for:
Determine the type of target pages, wherein type includes H5 page type and primary page type, H5 page type Cut-off rule, the page figure of the page of primary page type are provided between multiple functional module images in the page-images of the page Grayscale bar is provided between multiple functional module images as in;
If target pages belong to H5 page type, based on the segmentation in first page image and second page image First page image and second page image are divided into multiple first functional module images and multiple second functions by line respectively Module image;
If target pages belong to primary page type, based on the gray scale in first page image and second page image First page image and second page image are divided into multiple first functional module images and multiple second functions by item respectively Module image.
Optionally, contrast module 203 are used for:
For each first functional module image, by the first functional module image respectively with each second functional module image It compares, obtains multiple similarity thresholds, if multiple similarity thresholds are respectively less than default similarity threshold, it is determined that first Functional module image is newly-increased functional module image;
If the maximum similarity threshold value in multiple similarity thresholds is greater than default similarity threshold, it is determined that maximum similar The corresponding second functional module image of degree threshold value matches with the first functional module image, the first functional block diagram that will be matched Picture and the second functional module image carry out Detail contrast, obtain the location information in difference region.
Optionally, contrast module 203 are used for:
Pixel value is carried out to the first functional module image to match and the second functional module image to make the difference to obtain area Other image carries out corrosion treatment and expansion process to difference image;
Based on pixel value, the location information in region is distinguished in the difference image after determining corrosion treatment and expansion process.
Optionally, device further includes mark module, is used for:
Based on the location information in difference region, in the first functional module image to match and/or the second functional block diagram As in, difference region is marked.
Optionally, device further includes generation module, is used for:
Based on comparing result and examining report template, examining report is generated.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method Embodiment in be described in detail, no detailed explanation will be given here.
It should be understood that the device of page presentation provided by the above embodiment test is when carrying out page presentation test, Only the example of the division of the above functional modules, it in practical application, can according to need and by above-mentioned function distribution It is completed by different functional modules, i.e., the internal structure of equipment is divided into different functional modules, it is described above to complete All or part of function.In addition, the method for the device and page presentation test of page presentation test provided by the above embodiment Embodiment belongs to same design, and specific implementation process is detailed in embodiment of the method, and which is not described herein again.
Fig. 3 is a kind of structural block diagram of terminal provided by the embodiments of the present application.The terminal 300 can be Portable movable end End, such as: smart phone, tablet computer, intelligent camera.Terminal 300 is also possible to referred to as user equipment, portable terminal etc. Other titles.
In general, terminal 300 includes: processor 301 and memory 302.
Processor 301 may include one or more processing cores, such as 4 core processors, 8 core processors etc..Place Reason device 301 can use DSP (Digital Signal Processing, Digital Signal Processing), FPGA (Field- Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, may be programmed Logic array) at least one of example, in hardware realize.Processor 301 also may include primary processor and coprocessor, master Processor is the processor for being handled data in the awake state, also referred to as CPU (Central Processing Unit, central processing unit);Coprocessor is the low power processor for being handled data in the standby state.In In some embodiments, processor 301 can be integrated with GPU (Graphics Processing Unit, image processor), GPU is used to be responsible for the rendering and drafting of content to be shown needed for display screen.In some embodiments, processor 301 can also be wrapped AI (Artificial Intelligence, artificial intelligence) processor is included, the AI processor is for handling related machine learning Calculating operation.
Memory 302 may include one or more computer readable storage mediums, which can To be tangible and non-transient.Memory 302 may also include high-speed random access memory and nonvolatile memory, Such as one or more disk storage equipments, flash memory device.In some embodiments, non-transient in memory 302 Computer readable storage medium for storing at least one instruction, at least one instruction for performed by processor 301 with The method for realizing page presentation test provided herein.
In some embodiments, terminal 300 is also optional includes: peripheral device interface 303 and at least one peripheral equipment. Specifically, peripheral equipment includes: radio circuit 304, display screen 305, CCD camera assembly 306, voicefrequency circuit 307, positioning component At least one of 308 and power supply 309.
Peripheral device interface 303 can be used for I/O (Input/Output, input/output) is relevant outside at least one Peripheral equipment is connected to processor 301 and memory 302.In some embodiments, processor 301, memory 302 and peripheral equipment Interface 303 is integrated on same chip or circuit board;In some other embodiments, processor 301, memory 302 and outer Any one or two in peripheral equipment interface 303 can realize on individual chip or circuit board, the present embodiment to this not It is limited.
Radio circuit 304 is for receiving and emitting RF (Radio Frequency, radio frequency) signal, also referred to as electromagnetic signal.It penetrates Frequency circuit 304 is communicated by electromagnetic signal with communication network and other communication equipments.Radio circuit 304 turns electric signal It is changed to electromagnetic signal to be sent, alternatively, the electromagnetic signal received is converted to electric signal.Optionally, radio circuit 304 wraps It includes: antenna system, RF transceiver, one or more amplifiers, tuner, oscillator, digital signal processor, codec chip Group, user identity module card etc..Radio circuit 304 can be carried out by least one wireless communication protocol with other terminals Communication.The wireless communication protocol includes but is not limited to: WWW, Metropolitan Area Network (MAN), Intranet, each third generation mobile communication network (2G, 3G, 4G and 5G), WLAN and/or WiFi (Wireless Fidelity, Wireless Fidelity) network.In some embodiments, it penetrates Frequency circuit 304 can also include NFC (Near Field Communication, wireless near field communication) related circuit, this Application is not limited this.
Display screen 305 is for showing UI (User Interface, user interface).The UI may include figure, text, figure Mark, video and its their any combination.Display screen 305 also has acquisition on the surface or surface of touch display screen 305 Touch signal ability.The touch signal can be used as control signal and be input to processor 301 and be handled.Display screen 305 For providing virtual push button and/or dummy keyboard, also referred to as soft button and/or soft keyboard.In some embodiments, display screen 305 It can be one, the front panel of terminal 300 is set;In further embodiments, display screen 305 can be at least two, respectively The different surfaces of terminal 300 are set or in foldover design;In still other embodiments, display screen 305 can be Flexible Displays Screen, is arranged on the curved surface of terminal 300 or on fold plane.Even, display screen 305 can also be arranged to non-rectangle not advise Then figure, namely abnormity screen.Display screen 305 can using LCD (Liquid Crystal Display, liquid crystal display), The preparation of the materials such as OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode).
CCD camera assembly 306 is for acquiring image or video.Optionally, CCD camera assembly 306 include front camera and Rear camera.In general, front camera is for realizing video calling or self-timer, rear camera is for realizing photo or video Shooting.In some embodiments, rear camera at least two are main camera, depth of field camera, wide-angle imaging respectively Any one in head, to realize that main camera and the fusion of depth of field camera realize background blurring function, main camera and wide-angle Pan-shot and VR (Virtual Reality, virtual reality) shooting function are realized in camera fusion.In some embodiments In, CCD camera assembly 306 can also include flash lamp.Flash lamp can be monochromatic warm flash lamp, be also possible to double-colored temperature flash of light Lamp.Double-colored temperature flash lamp refers to the combination of warm light flash lamp and cold light flash lamp, can be used for the light compensation under different-colour.
Voicefrequency circuit 307 is used to provide the audio interface between user and terminal 300.Voicefrequency circuit 307 may include wheat Gram wind and loudspeaker.Microphone is used to acquire the sound wave of user and environment, and converts sound waves into electric signal and be input to processor 301 are handled, or are input to radio circuit 304 to realize voice communication.For stereo acquisition or the purpose of noise reduction, wheat Gram wind can be it is multiple, be separately positioned on the different parts of terminal 300.Microphone can also be array microphone or omnidirectional's acquisition Type microphone.Loudspeaker is then used to that sound wave will to be converted to from the electric signal of processor 301 or radio circuit 304.Loudspeaker can To be traditional wafer speaker, it is also possible to piezoelectric ceramic loudspeaker.When loudspeaker is piezoelectric ceramic loudspeaker, not only may be used To convert electrical signals to the audible sound wave of the mankind, the sound wave that the mankind do not hear can also be converted electrical signals to survey Away from etc. purposes.In some embodiments, voicefrequency circuit 307 can also include earphone jack.
Positioning component 308 is used for the current geographic position of positioning terminal 300, to realize navigation or LBS (Location Based Service, location based service).Positioning component 308 can be the GPS (Global based on the U.S. Positioning System, global positioning system), China dipper system or Russia Galileo system positioning group Part.
Power supply 309 is used to be powered for the various components in terminal 300.Power supply 309 can be alternating current, direct current, Disposable battery or rechargeable battery.When power supply 309 includes rechargeable battery, which can be wired charging electricity Pond or wireless charging battery.Wired charging battery is the battery to be charged by Wireline, and wireless charging battery is by wireless The battery of coil charges.The rechargeable battery can be also used for supporting fast charge technology.
In some embodiments, terminal 300 further includes having one or more sensors 310.The one or more sensors 310 include but is not limited to: acceleration transducer 311, gyro sensor 312, pressure sensor 313, fingerprint sensor 314, Optical sensor 315 and proximity sensor 316.
The acceleration that acceleration transducer 311 can detecte in three reference axis of the coordinate system established with terminal 300 is big It is small.For example, acceleration transducer 311 can be used for detecting component of the acceleration of gravity in three reference axis.Processor 301 can With the acceleration of gravity signal acquired according to acceleration transducer 311, control display screen 305 with transverse views or longitudinal view into The display of row user interface.Acceleration transducer 311 can be also used for the acquisition of game or the exercise data of user.
Gyro sensor 312 can detecte body direction and the rotational angle of terminal 300, and gyro sensor 312 can To cooperate with acquisition user to act the 3D of terminal 300 with acceleration transducer 311.Processor 301 is according to gyro sensor 312 Following function may be implemented in the data of acquisition: when action induction (for example changing UI according to the tilt operation of user), shooting Image stabilization, game control and inertial navigation.
The lower layer of side frame and/or display screen 305 in terminal 300 can be set in pressure sensor 313.Work as pressure sensing When the side frame of terminal 300 is arranged in device 313, can detecte user to the gripping signal of terminal 300, according to the gripping signal into Row right-hand man identification or prompt operation.It, can be according to user couple when the lower layer of display screen 305 is arranged in pressure sensor 313 The pressure operation of display screen 305, realization control the operability control on the interface UI.Operability control includes button At least one of control, scroll bar control, icon control, menu control.
Fingerprint sensor 314 is used to acquire the fingerprint of user, according to the identity of collected fingerprint recognition user.Knowing Not Chu the identity of user when being trusted identity, authorize the user to execute relevant sensitive operation, the sensitive operation by processor 301 Including solution lock screen, check encryption information, downloading software, payment and change setting etc..End can be set in fingerprint sensor 314 Front, the back side or the side at end 300.When being provided with physical button or manufacturer Logo in terminal 300, fingerprint sensor 314 can To be integrated with physical button or manufacturer Logo.
Optical sensor 315 is for acquiring ambient light intensity.In one embodiment, processor 301 can be according to optics The ambient light intensity that sensor 315 acquires controls the display brightness of display screen 305.Specifically, when ambient light intensity is higher, The display brightness of display screen 305 is turned up;When ambient light intensity is lower, the display brightness of display screen 305 is turned down.In another reality It applies in example, the ambient light intensity that processor 301 can also be acquired according to optical sensor 315, dynamic adjusts CCD camera assembly 306 Acquisition parameters.
Proximity sensor 316, also referred to as range sensor are generally arranged at the front of terminal 300.Proximity sensor 316 is used In the distance between the front of acquisition user and terminal 300.In one embodiment, when proximity sensor 316 detects user When the distance between front of terminal 300 gradually becomes smaller, display screen 305 is controlled by processor 301 and is switched to from bright screen state Cease screen state;When proximity sensor 316 detects user and the distance between the front of terminal 300 becomes larger, by handling Device 301 controls display screen 305 and is switched to bright screen state from breath screen state.
It will be understood by those skilled in the art that the restriction of the not structure paired terminal 300 of structure shown in Fig. 3, can wrap It includes than illustrating more or fewer components, perhaps combine certain components or is arranged using different components.
In the exemplary embodiment, a kind of computer readable storage medium is additionally provided, is stored at least in storage medium One instruction, at least one instruction are loaded by processor and are executed the side to realize the test of the page presentation in above-described embodiment Method.For example, the computer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk With optical data storage devices etc..
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely the preferred embodiments of the application, not to limit the application, it is all in spirit herein and Within principle, any modification, equivalent replacement, improvement and so on be should be included within the scope of protection of this application.

Claims (12)

1. a kind of method of page presentation test, which is characterized in that the described method includes:
Obtain first page image and second page image, wherein the first page image and the second page image are The image of the target pages of the application program of different editions;
By the first page image and the second page image, it is divided into multiple first functional module images and multiple respectively Second functional module image;
The multiple first functional module image and the multiple second functional module image are compared, comparison knot is obtained Fruit.
2. the method according to claim 1, wherein the acquisition first page image and second page image, Include:
The application program for installing and running different editions, the target pages for obtaining the application program of different editions are shown;
For the target pages of the application program of each version, the target pages are repeatedly slided into pre-determined distance, and successively right The part that the target pages are shown carries out screenshotss processing, obtains multiple first page image segments or more of the target pages A second page image segments are stopped if sliding number reaches preset threshold or slid into the bottom of the target pages Only by the processing of target pages sliding pre-determined distance;
Splicing is carried out to the multiple first page image segments and the multiple second page image segments respectively, is obtained First page image and second page image.
3. the method according to claim 1, wherein the acquisition first page image and second page image, Include:
Control script is sent to measured terminal, the control script is executed for controlling the measured terminal: being installed and is run not With the application program of version, the target pages for obtaining the application program of different editions are shown;Application for each version The target pages are repeatedly slided pre-determined distance, and the part successively shown to the target pages by the target pages of program Screenshotss processing is carried out, obtains the multiple first page image segments or multiple second page image segments of the target pages, such as Fruit sliding number reaches preset threshold or has slid into the bottom of the target pages, then stops sliding the target pages pre- If the processing of distance;Return to the multiple first page image segments and the multiple second pressure surface image segments;
When the multiple first page image segments and the multiple second pressure surface image for receiving the measured terminal return When segment, splicing is carried out respectively to the multiple first page image segments and the multiple second page image segments, Obtain first page image and second page image.
4. according to the described in any item methods of Claims 2 or 3, which is characterized in that described to the multiple first page image Segment and the multiple second page image segments, carry out splicing respectively, obtain first page image and second page figure Picture, comprising:
Duplicate removal processing is carried out to the multiple first page image segments and the multiple second page image segments respectively, will be gone Multiple first page image segments that treated again and multiple second page image segments carry out splicing respectively, obtain described First page image and the second page image.
5. the method according to claim 1, wherein described by the first page image and the second page Image is divided into multiple first functional module images and multiple second functional module images respectively, comprising:
Determining the type of the target pages, wherein the type includes H5 page type and primary page type, and described H5 pages Cut-off rule is provided between multiple functional module images in the page-images of the page of noodles type, the primary page type Grayscale bar is provided between multiple functional module images in the page-images of the page;
If the target pages belong to H5 page type, based in the first page image and the second page image Cut-off rule the first page image and the second page image are divided into multiple first functional module images respectively With multiple second functional module images;
If the target pages belong to primary page type, it is based on the first page image and the second page image In grayscale bar the first page image and the second page image are divided into multiple first functional block diagrams respectively Picture and multiple second functional module images.
6. the method according to claim 1, wherein it is described by the multiple first functional module image with it is described Multiple second functional module images, compare to obtain comparing result, comprising:
For each first functional module image, by the first functional module image respectively with each second functional module image It compares, obtains multiple similarity thresholds, if the multiple similarity threshold is respectively less than default similarity threshold, it is determined that The first functional module image is newly-increased functional module image;
If the maximum similarity threshold value in the multiple similarity threshold is greater than the default similarity threshold, it is determined that described The corresponding second functional module image of maximum similarity threshold value matches with the first functional module image, will to match One functional module image and the second functional module image carry out Detail contrast, obtain the location information in difference region.
7. according to the method described in claim 6, it is characterized in that, the first functional module image and second that will be matched Functional module image carries out Detail contrast, obtains the location information in difference region, comprising:
Pixel value is carried out to the first functional module image to match and the second functional module image to make the difference to obtain difference figure Picture carries out corrosion treatment and expansion process to the difference image;
Based on pixel value, the location information in region is distinguished in the difference image after determining corrosion treatment and expansion process.
8. the described in any item methods of according to claim 6 or 7, which is characterized in that the location information for obtaining difference region Later, further includes:
Based on the location information in the difference region, in the first functional module image to match and/or the second functional block diagram As in, the difference region is marked.
9. the method according to claim 1, wherein the method also includes:
Based on the comparing result and examining report template, examining report is generated.
10. a kind of device of page presentation test, which is characterized in that described device includes:
Module is obtained, for obtaining first page image and second page image, wherein the first page image and described the Two page-images are the images of the target pages of the application program of different editions;
Divide module, for being divided into multiple first functions respectively for the first page image and the second page image Module image and multiple second functional module images;
Contrast module, for carrying out pair the multiple first functional module image and the multiple second functional module image Than obtaining comparing result.
11. a kind of terminal, which is characterized in that the terminal includes processor and memory, is stored at least in the memory One instruction, at least one instruction are loaded by the processor and are executed as described in any one of claim 1 to 9 to realize The method of page presentation test.
12. a kind of computer readable storage medium, which is characterized in that be stored at least one in the computer readable storage medium Item instruction, at least one instruction are loaded by processor and are executed to realize page exhibition as described in any one of claim 1 to 9 Show the method for test.
CN201910814315.2A 2019-08-30 2019-08-30 Page display test method and device Active CN110532188B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910814315.2A CN110532188B (en) 2019-08-30 2019-08-30 Page display test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910814315.2A CN110532188B (en) 2019-08-30 2019-08-30 Page display test method and device

Publications (2)

Publication Number Publication Date
CN110532188A true CN110532188A (en) 2019-12-03
CN110532188B CN110532188B (en) 2021-06-29

Family

ID=68665511

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910814315.2A Active CN110532188B (en) 2019-08-30 2019-08-30 Page display test method and device

Country Status (1)

Country Link
CN (1) CN110532188B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111581091A (en) * 2020-04-30 2020-08-25 北京字节跳动网络技术有限公司 Page testing method and device, readable medium and electronic equipment
CN112286825A (en) * 2020-11-24 2021-01-29 北斗星通智联科技有限责任公司 Screen testing method and device for intelligent cabin and electronic equipment
CN112559342A (en) * 2020-12-09 2021-03-26 上海米哈游天命科技有限公司 Method, device and equipment for acquiring picture test image and storage medium
CN112732398A (en) * 2021-02-02 2021-04-30 三盟科技股份有限公司 Big data visualization management method and system based on artificial intelligence

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7546471B2 (en) * 2005-01-14 2009-06-09 Microsoft Corporation Method and system for virus detection using pattern matching techniques
CN102420712A (en) * 2010-09-28 2012-04-18 中国移动通信集团公司 Testing method and equipment
CN103795920A (en) * 2014-01-21 2014-05-14 宇龙计算机通信科技(深圳)有限公司 Photo processing method and device
CN104978270A (en) * 2015-07-03 2015-10-14 上海触乐信息科技有限公司 Automatic software testing method and apparatus
CN105095083A (en) * 2015-08-24 2015-11-25 上海斐讯数据通信技术有限公司 Mobile phone interface screenshot test method and device used in Android system
US20160077830A1 (en) * 2013-10-25 2016-03-17 International Business Machines Corporation Associating a visualization of user interface with source code
CN105955604A (en) * 2016-04-20 2016-09-21 乐视控股(北京)有限公司 Method and device for screen capture
US20160378937A1 (en) * 2014-05-30 2016-12-29 Roche Diabetes Care, Inc. Hazard based assessment patterns
CN107657583A (en) * 2017-08-29 2018-02-02 努比亚技术有限公司 A kind of screenshot method, terminal and computer-readable recording medium
CN108764352A (en) * 2018-05-25 2018-11-06 百度在线网络技术(北京)有限公司 Duplicate pages content detection algorithm and device
CN109118448A (en) * 2018-08-02 2019-01-01 北京奇虎科技有限公司 It takes pictures processing method, device and electronic equipment
US20190102604A1 (en) * 2017-09-30 2019-04-04 Beijing Kingsoft Internet Security Software Co., Ltd. Method of determining image background, device and medium
CN109859211A (en) * 2018-12-28 2019-06-07 努比亚技术有限公司 A kind of image processing method, mobile terminal and computer readable storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7546471B2 (en) * 2005-01-14 2009-06-09 Microsoft Corporation Method and system for virus detection using pattern matching techniques
CN102420712A (en) * 2010-09-28 2012-04-18 中国移动通信集团公司 Testing method and equipment
US20160077830A1 (en) * 2013-10-25 2016-03-17 International Business Machines Corporation Associating a visualization of user interface with source code
CN103795920A (en) * 2014-01-21 2014-05-14 宇龙计算机通信科技(深圳)有限公司 Photo processing method and device
US20160378937A1 (en) * 2014-05-30 2016-12-29 Roche Diabetes Care, Inc. Hazard based assessment patterns
CN104978270A (en) * 2015-07-03 2015-10-14 上海触乐信息科技有限公司 Automatic software testing method and apparatus
CN105095083A (en) * 2015-08-24 2015-11-25 上海斐讯数据通信技术有限公司 Mobile phone interface screenshot test method and device used in Android system
CN105955604A (en) * 2016-04-20 2016-09-21 乐视控股(北京)有限公司 Method and device for screen capture
CN107657583A (en) * 2017-08-29 2018-02-02 努比亚技术有限公司 A kind of screenshot method, terminal and computer-readable recording medium
US20190102604A1 (en) * 2017-09-30 2019-04-04 Beijing Kingsoft Internet Security Software Co., Ltd. Method of determining image background, device and medium
CN108764352A (en) * 2018-05-25 2018-11-06 百度在线网络技术(北京)有限公司 Duplicate pages content detection algorithm and device
CN109118448A (en) * 2018-08-02 2019-01-01 北京奇虎科技有限公司 It takes pictures processing method, device and electronic equipment
CN109859211A (en) * 2018-12-28 2019-06-07 努比亚技术有限公司 A kind of image processing method, mobile terminal and computer readable storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111581091A (en) * 2020-04-30 2020-08-25 北京字节跳动网络技术有限公司 Page testing method and device, readable medium and electronic equipment
CN111581091B (en) * 2020-04-30 2023-03-21 北京字节跳动网络技术有限公司 Page testing method and device, readable medium and electronic equipment
CN112286825A (en) * 2020-11-24 2021-01-29 北斗星通智联科技有限责任公司 Screen testing method and device for intelligent cabin and electronic equipment
CN112559342A (en) * 2020-12-09 2021-03-26 上海米哈游天命科技有限公司 Method, device and equipment for acquiring picture test image and storage medium
CN112732398A (en) * 2021-02-02 2021-04-30 三盟科技股份有限公司 Big data visualization management method and system based on artificial intelligence

Also Published As

Publication number Publication date
CN110532188B (en) 2021-06-29

Similar Documents

Publication Publication Date Title
CN110532188A (en) The method and apparatus of page presentation test
CN110148178A (en) Camera localization method, device, terminal and storage medium
CN110163296B (en) Image recognition method, device, equipment and storage medium
CN109886208B (en) Object detection method and device, computer equipment and storage medium
CN110532170A (en) Build method, apparatus, electronic equipment and the medium of test environment
CN109815150A (en) Application testing method, device, electronic equipment and storage medium
CN110784370B (en) Method and device for testing equipment, electronic equipment and medium
CN109862412A (en) It is in step with the method, apparatus and storage medium of video
CN109117635A (en) Method for detecting virus, device, computer equipment and the storage medium of application program
CN108829488A (en) Generate Web can interaction page method, apparatus and storage medium
CN110442521A (en) Control element detection method and device
CN110321228A (en) Call method, device, equipment and the computer readable storage medium of Native method
CN110321126A (en) The method and apparatus for generating page code
CN109302632A (en) Obtain method, apparatus, terminal and the storage medium of live video picture
CN109992685A (en) A kind of method and device of retrieving image
EP4040332A1 (en) Method and apparatus for upgrading an intelligent model and non-transitory computer readable storage medium
CN108734662A (en) The method and apparatus for showing icon
CN113627413A (en) Data labeling method, image comparison method and device
CN110175653A (en) Method, apparatus, equipment and the storage medium of image recognition
CN109189290B (en) Click area identification method and device and computer readable storage medium
CN110275655A (en) Lyric display method, device, equipment and storage medium
CN109308265A (en) The method and apparatus for generating negative testing use-case
CN109413190B (en) File acquisition method and device, electronic equipment and storage medium
CN109872294A (en) Image processing method, device, terminal and storage medium
CN110109770A (en) Adjustment method, device, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant