CN110532188B - Page display test method and device - Google Patents

Page display test method and device Download PDF

Info

Publication number
CN110532188B
CN110532188B CN201910814315.2A CN201910814315A CN110532188B CN 110532188 B CN110532188 B CN 110532188B CN 201910814315 A CN201910814315 A CN 201910814315A CN 110532188 B CN110532188 B CN 110532188B
Authority
CN
China
Prior art keywords
page
image
page image
function module
images
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.)
Active
Application number
CN201910814315.2A
Other languages
Chinese (zh)
Other versions
CN110532188A (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

Images

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

The application discloses a page display test method, and belongs to the technical field of automatic test. The method comprises the following steps: acquiring a first page image and a second page image, wherein the first page image and the second page image are images of target pages of application programs of different versions; dividing the first page image and the second page image into a plurality of first function module images and a plurality of second function module images respectively; and comparing the plurality of first functional module images with the plurality of second functional module images to obtain a comparison result. By adopting the method and the device, the technical problem that the accuracy of the test result is low due to the manual observation method in the related technology can be effectively solved.

Description

Page display test method and device
Technical Field
The application relates to the technical field of automatic testing, in particular to a method and a device for page display testing.
Background
Regression testing is required before a new version of APP (Application) comes online, i.e. the effect of changes in the code on the new version of APP is tested. The page display test is part of the regression test, i.e. tests what changes the page displayed by the new version of APP is compared with the page displayed by the old version of APP, whether there is a lack of some functional modules, etc.
The method for carrying out the page display test in the related technology is to manually observe the display page of the old version APP and the display page of the new version APP and record the difference between the two.
In the course of implementing the present application, the inventors found that the related art has at least the following problems:
for the manual observation method, small changes of some display pages or the loss of functional modules are easily missed by testers, so that the accuracy of test results is low.
Disclosure of Invention
The embodiment of the application provides a method and a device for page display testing, which can solve the technical problems in the related art. The technical scheme of the page display test method and device is as follows:
in a first aspect, a method for page display testing is provided, where the method includes:
acquiring a first page image and a second page image, wherein the first page image and the second page image are images of target pages of application programs of different versions;
dividing the first page image and the second page image into a plurality of first function module images and a plurality of second function module images respectively;
and comparing the plurality of first functional module images with the plurality of second functional module images to obtain a comparison result.
Optionally, the acquiring the first page image and the second page image includes:
installing and operating application programs of different versions, and acquiring target pages of the application programs of the different versions to display;
for a target page of each version of application program, sliding the target page for a preset distance for multiple times, sequentially performing screen capture processing on a displayed part of the target page, acquiring multiple first page image segments or multiple second page image segments of the target page, and stopping the processing of sliding the target page for the preset distance if the sliding times reach a preset threshold value or the target page slides to the bottom of the target page;
and respectively splicing the plurality of first page image fragments and the plurality of second page image fragments to obtain a first page image and a second page image.
Optionally, the acquiring the first page image and the second page image includes:
sending a control script to a tested terminal, wherein the control script is used for controlling the tested terminal to execute: installing and operating application programs of different versions, and acquiring target pages of the application programs of the different versions to display; for a target page of each version of application program, sliding the target page for a preset distance for multiple times, sequentially performing screen capture processing on a displayed part of the target page, acquiring multiple first page image segments or multiple second page image segments of the target page, and stopping the processing of sliding the target page for the preset distance if the sliding times reach a preset threshold value or the target page slides to the bottom of the target page; returning the plurality of first page image segments and the plurality of second impression image segments;
and when the plurality of first page image fragments and the plurality of second page image fragments returned by the tested terminal are received, respectively splicing the plurality of first page image fragments and the plurality of second page image fragments to obtain a first page image and a second page image.
Optionally, the splicing the plurality of first page image segments and the plurality of second page image segments to obtain a first page image and a second page image respectively includes:
and respectively carrying out duplication removal processing on the plurality of first page image fragments and the plurality of second page image fragments, and respectively splicing the plurality of first page image fragments and the plurality of second page image fragments subjected to duplication removal processing to obtain the first page image and the second page image.
Optionally, the dividing the first page image and the second page image into a plurality of first function module images and a plurality of second function module images respectively includes:
determining the type of the target page, wherein the type comprises an H5 page type and a native page type, a division line is arranged between a plurality of function module images in a page image of a page of the H5 page type, and a gray bar is arranged between a plurality of function module images in a page image of a page of the native page type;
if the target page belongs to the H5 page type, dividing the first page image and the second page image into a plurality of first function module images and a plurality of second function module images respectively based on dividing lines in the first page image and the second page image;
and if the target page belongs to a native page type, respectively dividing the first page image and the second page image into a plurality of first functional module images and a plurality of second functional module images based on the gray bars in the first page image and the second page image.
Optionally, the comparing the plurality of first function module images with the plurality of second function module images to obtain a comparison result includes:
for each first function module image, comparing the first function module image with each second function module image respectively to obtain a plurality of similarity thresholds, and if the similarity thresholds are smaller than a preset similarity threshold, determining that the first function module image is a newly added function module image;
and if the maximum similarity threshold value in the similarity threshold values is larger than the preset similarity threshold value, determining that the second function module image corresponding to the maximum similarity threshold value is matched with the first function module image, and comparing the details of the matched first function module image with the details of the second function module image to obtain the position information of the distinguished area.
Optionally, the comparing the matched first function module image with the second function module image to obtain the position information of the distinct region includes:
performing pixel value difference processing on the matched first functional module image and the second functional module image to obtain a difference image, and performing corrosion processing and expansion processing on the difference image;
based on the pixel values, position information of the distinguishing region in the difference image after the erosion processing and the expansion processing is determined.
Optionally, after obtaining the location information of the distinct region, the method further includes:
and marking the distinguishing region in the matched first function module image and/or second function module image based on the position information of the distinguishing region.
Optionally, the method further includes:
and generating a detection report based on the comparison result and the detection report template.
In a second aspect, an apparatus for page display testing is provided, the apparatus comprising:
the device comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring a first page image and a second page image, and the first page image and the second page image are images of target pages of application programs with different versions;
a dividing module, configured to divide the first page image and the second page image into a plurality of first function module images and a plurality of second function module images, respectively;
and the comparison module is used for comparing the plurality of first functional module images with the plurality of second functional module images to obtain a comparison result.
Optionally, the obtaining module is configured to:
installing and operating application programs of different versions, and acquiring target pages of the application programs of the different versions to display;
for a target page of each version of application program, sliding the target page for a preset distance for multiple times, sequentially performing screen capture processing on a displayed part of the target page, acquiring multiple first page image segments or multiple second page image segments of the target page, and stopping the processing of sliding the target page for the preset distance if the sliding times reach a preset threshold value or the target page slides to the bottom of the target page;
and respectively splicing the plurality of first page image fragments and the plurality of second page image fragments to obtain a first page image and a second page image.
Optionally, the obtaining module is configured to:
sending a control script to a tested terminal, wherein the control script is used for controlling the tested terminal to execute: installing and operating application programs of different versions, and acquiring target pages of the application programs of the different versions to display; for a target page of each version of application program, sliding the target page for a preset distance for multiple times, sequentially performing screen capture processing on a displayed part of the target page, acquiring multiple first page image segments or multiple second page image segments of the target page, and stopping the processing of sliding the target page for the preset distance if the sliding times reach a preset threshold value or the target page slides to the bottom of the target page; returning the plurality of first page image segments and the plurality of second impression image segments;
and when the plurality of first page image fragments and the plurality of second page image fragments returned by the tested terminal are received, respectively splicing the plurality of first page image fragments and the plurality of second page image fragments to obtain a first page image and a second page image.
Optionally, the obtaining module is configured to:
and respectively carrying out duplication removal processing on the plurality of first page image fragments and the plurality of second page image fragments, and respectively splicing the plurality of first page image fragments and the plurality of second page image fragments subjected to duplication removal processing to obtain the first page image and the second page image.
Optionally, the segmentation module is configured to:
determining the type of the target page, wherein the type comprises an H5 page type and a native page type, a division line is arranged between a plurality of function module images in a page image of a page of the H5 page type, and a gray bar is arranged between a plurality of function module images in a page image of a page of the native page type;
if the target page belongs to the H5 page type, dividing the first page image and the second page image into a plurality of first function module images and a plurality of second function module images respectively based on dividing lines in the first page image and the second page image;
and if the target page belongs to a native page type, respectively dividing the first page image and the second page image into a plurality of first functional module images and a plurality of second functional module images based on the gray bars in the first page image and the second page image.
Optionally, the comparison module is configured to:
for each first function module image, comparing the first function module image with each second function module image respectively to obtain a plurality of similarity thresholds, and if the similarity thresholds are smaller than a preset similarity threshold, determining that the first function module image is a newly added function module image;
and if the maximum similarity threshold value in the similarity threshold values is larger than the preset similarity threshold value, determining that the second function module image corresponding to the maximum similarity threshold value is matched with the first function module image, and comparing the details of the matched first function module image with the details of the second function module image to obtain the position information of the distinguished area.
Optionally, the comparison module is configured to:
performing pixel value difference processing on the matched first functional module image and the second functional module image to obtain a difference image, and performing corrosion processing and expansion processing on the difference image;
based on the pixel values, position information of the distinguishing region in the difference image after the erosion processing and the expansion processing is determined.
Optionally, the apparatus further comprises a marking module, configured to:
and marking the distinguishing region in the matched first function module image and/or second function module image based on the position information of the distinguishing region.
Optionally, the apparatus further includes a generating module, configured to:
and generating a detection report based on the comparison result and the detection report template.
In a third aspect, a terminal is provided, where the terminal includes a processor and a memory, and the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method for page display testing according to the first aspect.
In a fourth aspect, a computer-readable storage medium is provided, in which at least one instruction is stored, and the at least one instruction is loaded and executed by a processor to implement the method for page show testing according to the first aspect.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
the page display test method provided by the embodiment of the application comprises the steps of firstly, obtaining a first page image and a second page image. Then, the first page image and the second page image are divided into a plurality of first function module images and a plurality of second function module images, respectively. And finally, comparing the plurality of first functional module images with the plurality of second functional module images to obtain a comparison result. Therefore, the page display testing method provided by the embodiment of the application does not need to manually observe the difference of display pages of different versions, but automatically compares the display pages, so that small changes of some display pages or lack of functional modules are not easy to omit, and the accuracy of the test result is higher.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a method for page display testing according to an embodiment of the present disclosure;
FIG. 2 is a schematic structural diagram of an apparatus for page display testing according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a terminal according to an embodiment of the present application;
FIG. 4 is a diagram of an application target page address management interface according to an embodiment of the present disclosure;
FIG. 5 is a flowchart of a screen capture, deduplication, and stitching process provided by an embodiment of the present application;
FIG. 6 is a diagram of a target page of an application provided in an embodiment of the present application;
fig. 7 is a schematic diagram illustrating a comparison between a first function module image and a second function module image that are matched according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The embodiment of the application provides a page display test method, which can be realized by a terminal. The terminal can be a mobile terminal such as a mobile phone, a tablet computer and a notebook computer, and can also be a fixed terminal such as a desktop computer. Specifically, the method provided by the embodiment of the application can be realized by a test platform, and can also be realized by matching the test platform with a tested terminal, wherein an application program which needs to be subjected to a page display test is installed in the tested terminal, the test platform is used for controlling the tested terminal, and the test platform is a terminal device.
The embodiment of the application provides a page display test method which can be used for testing whether pages displayed by APP of different versions are different or not. First, a first page image of a first version of an application program is acquired, and a second page image of a second version of the application program is acquired. Then, the first page image and the second page image are divided into a plurality of first function module images and a plurality of second function module images, respectively. And finally, comparing the plurality of first function module images with the plurality of second function module images to obtain a comparison result.
As shown in fig. 1, the processing flow of the method for page display testing may include the following steps:
in step 101, a first page image and a second page image are acquired.
Wherein the first page image and the second page image are images of target pages of different versions of the application program. Specifically, the first page image may be an image of a target page of a new version of the application, and the second page image may be an image of a target page of an old version of the application. The first page image may be an image of a target page of an IOS version application program, and the second page image may be an image of a target page of an Android version application program.
In implementation, the first page image and the second page image can be manually acquired and stored by a tester, and then the test platform can acquire the first page image and the second page image which are stored in advance.
The first page image and the second page image can also be obtained by automatic screenshot and splicing, and specifically, the following two conditions can be adopted:
in the first case, referring to fig. 5, the application program to be subjected to the page display test is installed on the test platform, and the specific steps of acquiring the first page image and the second page image may be executed by the test platform separately. In the corresponding processing procedure, as described below, the test platform installs and runs the application programs of different versions, and obtains and displays the target pages of the application programs of different versions. And for the target page of each version of the application program, sliding the target page for a preset distance for multiple times, sequentially carrying out screen capture processing on the displayed part of the target page, acquiring a plurality of first page image segments or a plurality of second page image segments of the target page, and stopping the processing of sliding the target page for the preset distance if the sliding times reach a preset threshold value or have slid to the bottom of the target page. And respectively splicing the plurality of first page image fragments and the plurality of second page image fragments to obtain a first page image and a second page image.
The first page image may be a full-length image of a target page of the first version of the application program, and the second page image may be a full-length image of a target page of the second version of the application program.
In implementation, firstly, a tester enters information of a target page of an application program of a first version and a second version in a test platform, wherein as shown in fig. 4, the information at least includes storage location information of the target page, and may further include a number, team information, version information, platform information, name information, and the like of the target page.
And then, automatically downloading and installing the application program of the first version by the test platform, and automatically capturing and sequentially displaying all target pages of the application program of the first version based on the pre-recorded storage position information of the target pages of the application program of the first version. And for each target page, sliding the target page for a preset distance for multiple times, and sequentially performing screen capture processing on the displayed part of the target page until the displayed part slides to the bottom of the target page, so as to obtain a plurality of first page image fragments of the target page. In some cases, the target page does not have a bottom, for example, for a microblog, the page may be slid down all the time, so as to continuously obtain new content. Therefore, when the number of slips reaches a preset threshold, the slips should be stopped to avoid wasting computer resources. And performing the processing on all target pages of the application program of the first version to obtain a plurality of first page image fragments of all the target pages.
Then, the test platform can automatically unload the application program of the first version, automatically download and install the application program of the second version, and automatically capture all target pages of the application program of the second version to be sequentially displayed based on the pre-recorded storage position information of the target pages of the application program of the second version. And for each target page, sliding the target page for a preset distance for multiple times, and sequentially performing screen capture processing on the displayed part of the target page until the displayed part slides to the bottom of the target page, so as to obtain a plurality of second page image fragments of the target page. In some cases, the target page does not have a bottom, for example, for a microblog, the page may be slid down all the time, so as to continuously obtain new content. Therefore, when the number of slips reaches a preset threshold, the slips should be stopped to avoid wasting computer resources. And performing the processing on all target pages of the application program of the second version to obtain a plurality of second page image fragments of all the target pages.
And finally, splicing a plurality of first page image fragments and a plurality of second page image fragments of the same target page of the application program of the first version and the second version respectively to obtain a first page image and a second page image.
In the second case, referring to fig. 5, an application program that needs to perform a page display test is installed on a terminal to be tested, and a test platform and the terminal to be tested cooperate to obtain a first page image and a second page image, so that the corresponding processing procedure may be as follows, where the test platform sends a control script to the terminal to be tested, and the control script is used to control the terminal to be tested to execute: installing and operating application programs of different versions, and acquiring target pages of the application programs of the different versions to display; for a target page of each version of application program, sliding the target page for a preset distance for multiple times, sequentially performing screen capture processing on a displayed part of the target page, acquiring multiple first page image segments or multiple second page image segments of the target page, and stopping the processing of sliding the target page for the preset distance if the sliding times reach a preset threshold value or the target page slides to the bottom of the target page; returning the plurality of first page image segments and the plurality of second impression image segments. And when the test platform receives the plurality of first page image fragments and the plurality of second pressing image fragments returned by the tested terminal, splicing the plurality of first page image fragments and the plurality of second page image fragments respectively to obtain a first page image and a second page image.
The first page image may be a full-length image of a target page of the first version of the application program, and the second page image may be a full-length image of a target page of the second version of the application program.
The application program which needs to be subjected to the page display test is installed in the tested terminal, and the tested terminal is in wireless connection or wired connection with the test platform.
In implementation, firstly, a tester enters information of a target page of an application program of a first version and a second version in a test platform, wherein as shown in fig. 4, the information at least includes storage location information of the target page, and may further include a number, team information, version information, platform information, name information, and the like of the target page.
And then, the test platform sends a control script to the tested terminal so as to control the tested terminal to perform screen capture processing. Specifically, after the tested terminal receives the control script, the tested terminal automatically downloads and installs the application program of the first version based on the control script, and automatically captures all target pages of the application program of the first version to be sequentially displayed on the tested terminal based on the storage position information of the target pages of the application program of the first version which is recorded in advance. And for each target page, the test platform controls the tested terminal to slide the target page for a preset distance for multiple times, and sequentially performs screen capture processing on the displayed part of the target page until the displayed part slides to the bottom of the target page, so that a plurality of first page image fragments of the target page are obtained. In some cases, the target page does not have a bottom, for example, for a microblog, the page may be slid down all the time, so as to continuously obtain new content. Therefore, when the number of slips reaches a preset threshold, the slips should be stopped to avoid wasting computer resources. And performing the processing on all target pages of the application program of the first version to obtain a plurality of first page image fragments of all the target pages.
Then, under the control of the test platform, the tested terminal can automatically unload the application program of the first version, automatically download and install the application program of the second version, and automatically capture all target pages of the application program of the second version and sequentially display the target pages on the tested terminal based on the position information of the target pages of the application program of the second version which is input in advance. And for each target page, the test platform controls the tested terminal to slide the target page for a preset distance for multiple times, and sequentially performs screen capture processing on the displayed part of the target page until the displayed part slides to the bottom of the target page, so that a plurality of first page image fragments of the target page are obtained. In some cases, the target page does not have a bottom, for example, for a microblog, the page may be slid down all the time, so as to continuously obtain new content. Therefore, when the number of slips reaches a preset threshold, the slips should be stopped to avoid wasting computer resources. And performing the processing on all target pages of the application program of the second version to obtain a plurality of second page image fragments of all the target pages. The terminal under test may then uninstall the second version of the application.
That is, in the process, the test platform controls the tested terminal to download, install and uninstall the application programs of different versions, and controls the tested terminal to display a plurality of target pages, so that the whole process of operating the application programs of different versions by a user is simulated.
And finally, the tested terminal sends the acquired multiple first page image fragments and multiple second page images to the test platform. After the test platform receives the plurality of first page image fragments and the plurality of second page image fragments sent by the tested terminal, the test platform splices the plurality of first page image fragments of the target page of the application program of the first version to obtain a first page image; and splicing the plurality of second page image segments of the target page of the second version of the application program to obtain a second page image.
It should be noted that, in the above processing procedure, the test platform enables the terminal under test to automatically install and uninstall the application programs of the first version and the second version based on the TestNGjar package. The test platform can control the tested terminal to capture the screen through the drive interface of the Apium. The test platform can automatically acquire all target pages to be displayed on the tested terminal based on Jenkins and apple open source automation tools.
Optionally, referring to fig. 5, in order to make the first page image and the second page image obtained by stitching more accurate, in the above two cases, when the multiple first page image segments and the multiple second page image segments are stitched, both the first page image segments and the second page image segments may be subjected to deduplication processing, and the corresponding processing process may be as follows.
In implementation, sometimes, two adjacent page image segments that are captured contain repeated portions, and if the splicing processing is directly performed at this time, the spliced first page image or second page image may contain repeated portions, which is not favorable for subsequent segmentation processing and is also not favorable for subsequent comparison processing. Therefore, the repeated parts in the two adjacent page image segments need to be subjected to duplicate removal, and when the duplicate removal is performed, the repeated part in any one of the two adjacent page image segments can be removed, and the repeated part in the other page image segment is reserved, so that the incomplete splicing of the first page image or the second page image caused by the removal of the repeated parts in the two adjacent page image segments is avoided.
When the duplicate removal processing is performed, firstly, repeated parts in two adjacent page image segments can be identified based on the pixel value of each pixel point, then, the position of the repeated part in at least one page image segment is determined based on the position information of the pixel point, and the repeated part in the page image segment is removed based on the position of the repeated part. And finally, splicing the page image segments. And during splicing, sequentially splicing the image segments of each page from head to tail.
It should be noted that the above-mentioned page image segment is the first page image segment or the second page image segment.
After the first page image and the second page image are obtained by stitching, the processing of step 102 may be performed.
In step 102, the first page image and the second page image are divided into a plurality of first function module images and a plurality of second function module images, respectively.
The functional module image refers to an image corresponding to content of the same topic in the first page image, for example, in the microblog application program shown in fig. 6, an image corresponding to content issued by each user is a functional module image.
For example, for a microblog page image, an image corresponding to content published by each user is a functional module image, and a boundary mark is often set between different functional module images, and optionally, the boundary mark may be a dividing line or a gray bar.
In implementation, boundaries of each functional module image in the page image can be marked manually, and then the test platform can divide the page image into a plurality of functional module images through the marked boundaries.
Optionally, the page image may be divided into a plurality of functional module images according to a gray scale or a dividing line in the page image. Accordingly, the processing procedure corresponding to step 102 may determine the type of the target page, where the type of the target page includes an H5 page type and a native page type, a division line is set between a plurality of function module images in the page image of the page of the H5 page type, and a gray bar is set between a plurality of function module images in the page image of the page of the native page type. If the target page belongs to the H5 page type, the first page image and the second page image are divided into a plurality of first function module images and a plurality of second function module images, respectively, based on the dividing lines in the first page image and the second page image. And if the target page belongs to the native page type, respectively segmenting the first page image and the second page image into a plurality of first functional module images and a plurality of second functional module images based on the gray strips in the first page image and the second page image.
The H5 page is a page created using html 5. The native page refers to a page of an application program that can directly run on a current operating system, that is, a page of the native program, and may also be referred to as a native page.
In implementation, the type of the target page can be judged based on the storage location information of the target page previously recorded in the test platform, that is, the types of the target page are different, and the expression forms of the storage location information of the target page are greatly different. After the type of the target page is determined, the segmentation mode of the page image can be determined according to the specific type of the target page.
When the target page belongs to the native page type, as shown in fig. 6, since the gray bars are provided between the plurality of function module images in the page image of the native page type, the page image may be segmented based on the gray bars. Specifically, the position information of the gray strip may be determined through pixel identification, and then the page image may be segmented based on the position information of the gray strip. During segmentation, the gray strips can be removed, namely, any functional module image does not comprise the gray strips.
When the target page belongs to the H5 page type, since a dividing line is provided between the plurality of function module images in the page image of the H5 page type, the page image can be divided based on the dividing line. Specifically, the position information of the dividing line may be determined by pixel recognition, and then the page image may be divided based on the position information of the dividing line.
It should be noted that the above-mentioned page image is a first page image or a second page image, and the above-mentioned function module image is a first function module image or a second function module image.
The processing of step 103 may be performed after the first page image is divided into a plurality of first function module images and the second page image is divided into a plurality of second function module images.
In step 103, the plurality of first function module images and the plurality of second function module images are compared to obtain a comparison result.
In implementation, when the number of the function module images of the application programs of different versions is consistent and matched one by one, the plurality of first function module images and the plurality of second function module images can be sequentially compared, so that a comparison result is obtained.
Optionally, if the number of the first function module images is different from that of the second function module images, or if the first function module images and the second function module images are not matched with each other, the first function module images and the second function module images that are matched with each other may be determined first, and then the first function module images and the second function module images that are matched with each other are compared with each other in detail, then the corresponding processing procedure of step 103 may be as follows, for each first function module image, the first function module image is compared with each second function module image respectively to obtain a plurality of similarity thresholds, and if the plurality of similarity thresholds are all smaller than a preset similarity threshold, the first function module image is determined to be a newly added function module image. And if the maximum similarity threshold value in the similarity threshold values is larger than the preset similarity threshold value, determining that the second function module image corresponding to the maximum similarity threshold value is matched with the first function module image, and comparing the details of the matched first function module image with the details of the second function module image to obtain the position information of the distinguished area.
In implementation, during comparison, for each first functional module image, the first functional module image is compared with each second functional module image (i.e. the first functional module image is used to traverse all the second functional module images), and a plurality of similarity thresholds are obtained. If the obtained similarity thresholds are all smaller than the preset similarity threshold, the first function module image is a newly added function module image, namely, a second function module image matched with the first function module image does not exist, and at the moment, the first function module image and any second function module image are not subjected to detail comparison; if the maximum similarity threshold value in the obtained multiple similarity threshold values is larger than the preset similarity threshold value, it is indicated that a second function module image matched with the first function module image exists, and the second function module image corresponding to the maximum similarity threshold value is determined to be the second function module image matched with the first function module image.
And performing the processing on all the first function module images to obtain the newly added first function module images and the second function module images which are matched with the newly added first function module images. And then, comparing the details of the matched first function module image and the second function module image to obtain the position information of the distinguishing area.
The comparison result may include the newly added first function module image, the first function module image and the second function module image group each matching, and the position information of the distinguished region.
It should be noted that, when the first function module image and the second function module image are compared, a fuzzy matching algorithm may be used, the fuzzy matching algorithm may also be referred to as a local matching algorithm, and specifically, a FAST feature point detection algorithm may be used.
Optionally, a specific process of comparing details of the matched first functional module image and the matched second functional module image may be as follows, wherein a difference processing is performed on pixel values of the matched first functional module image and the matched second functional module image to obtain a difference image, and the difference image is subjected to erosion processing and expansion processing. Based on the pixel values, position information of the distinguishing region in the difference image after the erosion processing and the expansion processing is determined.
The position information of the distinguishing region may include position information of each pixel point of the distinguishing region, specifically, a coordinate value of each pixel point, or may include position information of a minimum circumscribed block diagram of the distinguishing region, and specifically, a coordinate value of a vertex of the minimum circumscribed block diagram.
In implementation, by performing pixel value difference processing on the matched first functional module image and second functional module image, the same portion (i.e., the unchanged portion in the functional module image) in the two functional module images can be removed, so as to obtain a difference image. Then, the difference image is corroded to strengthen the darkness and remove noise, and then the difference image is expanded to highlight different pixel points. And finally, determining the position information of the distinguishing region based on the pixel values of the pixel points.
In the above-mentioned pixel value difference processing, the pixel value of each pixel point of the first functional module image may be subtracted from the pixel value of each pixel point of the second functional module image, or the pixel value of each pixel point of the second functional module image may be subtracted from the pixel value of each pixel point of the first functional module image, which is not limited in this application.
Alternatively, the distinguishing region may be marked, and the corresponding processing procedure may be as follows, in the matched first function module image and/or second function module image, the distinguishing region is marked based on the position information of the distinguishing region.
In an implementation, after the position information of the distinct region is obtained, the distinct region may be marked based on the position information of the distinct region. For example, when the position information includes a coordinate value of a vertex of the minimum bounding box of the distinction region, the minimum bounding box of the distinction region may be drawn based on the coordinate value of the vertex of the minimum bounding box.
When the difference region is marked, the difference region may be marked only in the first function module image, may be marked only in the second function module image, or may be marked in both the first function module image and the second function module image. In one possible implementation, the distinguishing region may be marked with a rectangular box or a circular box, as shown in fig. 7, and may also be marked with an arrow.
Because the distinguished areas are marked, slight differences in the matched first functional module image and the matched second functional module image can be captured, and therefore the accuracy of page display testing is improved.
Optionally, a detection report may also be generated, and the corresponding processing procedure may be as follows, and based on the comparison result and the detection report template, the detection report is generated.
In implementation, the detection report template may be a templated file, and when the detection report is generated, the comparison result may be directly filled in the corresponding position of the detection report template, i.e. the detection report may be generated.
The page display test method provided by the embodiment of the application comprises the steps of firstly, obtaining a first page image and a second page image. Then, the first page image and the second page image are divided into a plurality of first function module images and a plurality of second function module images, respectively. And finally, comparing the plurality of first functional module images with the plurality of second functional module images to obtain a comparison result. Therefore, the page display testing method provided by the embodiment of the application does not need to manually observe the difference of display pages of different versions, but automatically compares the display pages, so that small changes of some display pages or lack of functional modules are not easy to omit, and the accuracy of the test result is higher. And moreover, the labor cost of a tester is reduced.
Based on the same technical concept, an embodiment of the present application further provides a device for page display testing, where the device may be a terminal in the foregoing embodiment, as shown in fig. 2, the device includes:
an obtaining module 201, configured to obtain a first page image and a second page image, where the first page image and the second page image are images of target pages of different versions of an application program;
a dividing module 202, configured to divide the first page image and the second page image into a plurality of first function module images and a plurality of second function module images, respectively;
and the comparison module 203 is configured to compare the plurality of first function module images with the plurality of second function module images to obtain a comparison result.
Optionally, the obtaining module 201 is configured to:
installing and operating application programs of different versions, and acquiring target pages of the application programs of the different versions to display;
for a target page of each version of application program, sliding the target page for a preset distance for multiple times, sequentially performing screen capture processing on a displayed part of the target page, acquiring multiple first page image segments or multiple second page image segments of the target page, and stopping the processing of sliding the target page for the preset distance if the sliding times reach a preset threshold value or the target page slides to the bottom of the target page;
and respectively splicing the plurality of first page image fragments and the plurality of second page image fragments to obtain a first page image and a second page image.
Optionally, the obtaining module 201 is configured to:
sending a control script to the tested terminal, wherein the control script is used for controlling the tested terminal to execute: installing and operating application programs of different versions, and acquiring target pages of the application programs of the different versions to display; for a target page of each version of application program, sliding the target page for a preset distance for multiple times, sequentially performing screen capture processing on a displayed part of the target page, acquiring multiple first page image segments or multiple second page image segments of the target page, and stopping the processing of sliding the target page for the preset distance if the sliding times reach a preset threshold value or the target page slides to the bottom of the target page; returning a plurality of first page image segments and a plurality of second impression image segments;
and when receiving the plurality of first page image segments and the plurality of second pressing image segments returned by the tested terminal, respectively splicing the plurality of first page image segments and the plurality of second page image segments to obtain a first page image and a second page image.
Optionally, the obtaining module 201 is configured to:
and respectively carrying out duplication removal processing on the plurality of first page image fragments and the plurality of second page image fragments, and respectively splicing the plurality of first page image fragments and the plurality of second page image fragments subjected to duplication removal processing to obtain a first page image and a second page image.
Optionally, the segmenting module 202 is configured to:
determining the type of a target page, wherein the type comprises an H5 page type and a native page type, dividing lines are arranged among a plurality of function module images in a page image of a page of the H5 page type, and gray bars are arranged among a plurality of function module images in the page image of the page of the native page type;
if the target page belongs to the H5 page type, dividing the first page image and the second page image into a plurality of first function module images and a plurality of second function module images respectively based on the dividing lines in the first page image and the second page image;
and if the target page belongs to the native page type, respectively segmenting the first page image and the second page image into a plurality of first functional module images and a plurality of second functional module images based on the gray strips in the first page image and the second page image.
Optionally, the comparison module 203 is configured to:
for each first function module image, comparing the first function module image with each second function module image respectively to obtain a plurality of similarity thresholds, and if the similarity thresholds are all smaller than a preset similarity threshold, determining the first function module image as a newly added function module image;
and if the maximum similarity threshold value in the similarity threshold values is larger than the preset similarity threshold value, determining that the second function module image corresponding to the maximum similarity threshold value is matched with the first function module image, and comparing the matched first function module image with the second function module image in detail to obtain the position information of the distinguished area.
Optionally, the comparison module 203 is configured to:
performing pixel value difference processing on the matched first functional module image and the second functional module image to obtain a difference image, and performing corrosion processing and expansion processing on the difference image;
based on the pixel values, position information of the distinguishing region in the difference image after the erosion processing and the expansion processing is determined.
Optionally, the apparatus further comprises a marking module configured to:
and marking the distinguishing area in the matched first function module image and/or second function module image based on the position information of the distinguishing area.
Optionally, the apparatus further includes a generating module, configured to:
and generating a detection report based on the comparison result and the detection report template.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
It should be noted that: in the page display testing apparatus provided in the above embodiment, when performing the page display test, only the division of the functional modules is illustrated, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the page display test apparatus provided in the above embodiment and the page display test method embodiment belong to the same concept, and specific implementation processes thereof are described in the method embodiment and are not described herein again.
Fig. 3 is a block diagram of a terminal according to an embodiment of the present disclosure. The terminal 300 may be a portable mobile terminal such as: smart phones, tablet computers, smart cameras. The terminal 300 may also be referred to by other names such as user equipment, portable terminal, etc.
Generally, the terminal 300 includes: a processor 301 and a memory 302.
The processor 301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 301 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 301 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 301 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
Memory 302 may include one or more computer-readable storage media, which may be tangible and non-transitory. Memory 302 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 302 is used to store at least one instruction for execution by processor 301 to implement the method of page show testing provided herein.
In some embodiments, the terminal 300 may further include: a peripheral interface 303 and at least one peripheral. Specifically, the peripheral device includes: at least one of radio frequency circuitry 304, display screen 305, camera assembly 306, audio circuitry 307, positioning assembly 308, and power supply 309.
The peripheral interface 303 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 301 and the memory 302. In some embodiments, processor 301, memory 302, and peripheral interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 301, the memory 302 and the peripheral interface 303 may be implemented on a separate chip or circuit board, which is not limited by the embodiment.
The Radio Frequency circuit 304 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 304 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 304 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 304 comprises: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuitry 304 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: the world wide web, metropolitan area networks, intranets, generations of mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the rf circuit 304 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 305 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. The display screen 305 also has the ability to capture touch signals on or over the surface of the touch display screen 305. The touch signal may be input to the processor 301 as a control signal for processing. The display screen 305 is used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 305 may be one, providing the front panel of the terminal 300; in other embodiments, the display screens 305 may be at least two, respectively disposed on different surfaces of the terminal 300 or in a folded design; in still other embodiments, the display 305 may be a flexible display disposed on a curved surface or on a folded surface of the terminal 300. Even further, the display screen 305 may be arranged in a non-rectangular irregular figure, i.e. a shaped screen. The Display screen 305 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and the like.
The camera assembly 306 is used to capture images or video. Optionally, camera assembly 306 includes a front camera and a rear camera. Generally, a front camera is used for realizing video call or self-shooting, and a rear camera is used for realizing shooting of pictures or videos. In some embodiments, the number of the rear cameras is at least two, and each of the rear cameras is any one of a main camera, a depth-of-field camera and a wide-angle camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting function and a VR (Virtual Reality) shooting function. In some embodiments, camera assembly 306 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
Audio circuit 307 is used to provide an audio interface between the user and terminal 300. Audio circuitry 307 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 301 for processing or inputting the electric signals to the radio frequency circuit 304 to realize voice communication. The microphones may be provided in plural numbers, respectively, at different portions of the terminal 300 for the purpose of stereo sound collection or noise reduction. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 301 or the radio frequency circuitry 304 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, audio circuitry 307 may also include a headphone jack.
The positioning component 308 is used to locate the current geographic Location of the terminal 300 to implement navigation or LBS (Location Based Service). The Positioning component 308 may be a Positioning component based on the Global Positioning System (GPS) in the united states, the beidou System in china, or the galileo System in russia.
The power supply 309 is used to supply power to the various components in the terminal 300. The power source 309 may be alternating current, direct current, disposable batteries, or rechargeable batteries. When the power source 309 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the terminal 300 also includes one or more sensors 310. The one or more sensors 310 include, but are not limited to: acceleration sensor 311, gyro sensor 312, pressure sensor 313, fingerprint sensor 314, optical sensor 315, and proximity sensor 316.
The acceleration sensor 311 may detect the magnitude of acceleration in three coordinate axes of a coordinate system established with the terminal 300. For example, the acceleration sensor 311 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 301 may control the display screen 305 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 311. The acceleration sensor 311 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 312 may detect a body direction and a rotation angle of the terminal 300, and the gyro sensor 312 may cooperate with the acceleration sensor 311 to acquire a 3D motion of the user on the terminal 300. The processor 301 may implement the following functions according to the data collected by the gyro sensor 312: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
The pressure sensor 313 may be disposed on a side bezel of the terminal 300 and/or on a lower layer of the display screen 305. When the pressure sensor 313 is disposed at the side frame of the terminal 300, a user's grip signal of the terminal 300 can be detected, and left-right hand recognition or shortcut operation can be performed according to the grip signal. When the pressure sensor 313 is disposed at the lower layer of the display screen 305, the operability control on the UI interface can be controlled according to the pressure operation of the user on the display screen 305. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 314 is used for collecting a fingerprint of a user to identify the identity of the user according to the collected fingerprint. Upon identifying that the user's identity is a trusted identity, processor 301 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings, etc. The fingerprint sensor 314 may be disposed on the front, back, or side of the terminal 300. When a physical button or a vendor Logo is provided on the terminal 300, the fingerprint sensor 314 may be integrated with the physical button or the vendor Logo.
The optical sensor 315 is used to collect the ambient light intensity. In one embodiment, the processor 301 may control the display brightness of the display screen 305 based on the ambient light intensity collected by the optical sensor 315. Specifically, when the ambient light intensity is high, the display brightness of the display screen 305 is increased; when the ambient light intensity is low, the display brightness of the display screen 305 is reduced. In another embodiment, the processor 301 may also dynamically adjust the shooting parameters of the camera head assembly 306 according to the ambient light intensity collected by the optical sensor 315.
A proximity sensor 316, also known as a distance sensor, is typically provided on the front face of the terminal 300. The proximity sensor 316 is used to collect the distance between the user and the front surface of the terminal 300. In one embodiment, when the proximity sensor 316 detects that the distance between the user and the front surface of the terminal 300 gradually decreases, the processor 301 controls the display screen 305 to switch from the bright screen state to the dark screen state; when the proximity sensor 316 detects that the distance between the user and the front surface of the terminal 300 is gradually increased, the display screen 305 is controlled by the processor 301 to switch from the breath-screen state to the bright-screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 3 is not intended to be limiting of terminal 300 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
In an exemplary embodiment, a computer-readable storage medium is further provided, in which at least one instruction is stored, and the at least one instruction is loaded and executed by a processor to implement the method for page display testing in the foregoing embodiments. For example, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (12)

1. A method for page display testing, the method comprising:
acquiring a first page image and a second page image, wherein the first page image and the second page image are images of target pages of application programs of different versions;
dividing the first page image and the second page image into a plurality of first function module images and a plurality of second function module images respectively, wherein the first function module images and the second function module images are images corresponding to the content of the same theme in the first page image and the second page image respectively, and a boundary sign is arranged between every two adjacent first function module images and every two adjacent second function module images and comprises at least one of a gray bar and a dividing line;
and comparing the plurality of first functional module images with the plurality of second functional module images to obtain a comparison result.
2. The method of claim 1, wherein said acquiring a first page image and a second page image comprises:
installing and operating application programs of different versions, and acquiring target pages of the application programs of the different versions to display;
for a target page of each version of application program, sliding the target page for a preset distance for multiple times, sequentially performing screen capture processing on a displayed part of the target page, acquiring multiple first page image segments or multiple second page image segments of the target page, and stopping the processing of sliding the target page for the preset distance if the sliding times reach a preset threshold value or the target page slides to the bottom of the target page;
and respectively splicing the plurality of first page image fragments and the plurality of second page image fragments to obtain a first page image and a second page image.
3. The method of claim 1, wherein said acquiring a first page image and a second page image comprises:
sending a control script to a tested terminal, wherein the control script is used for controlling the tested terminal to execute: installing and operating application programs of different versions, and acquiring target pages of the application programs of the different versions to display; for a target page of each version of application program, sliding the target page for a preset distance for multiple times, sequentially performing screen capture processing on a displayed part of the target page, acquiring multiple first page image segments or multiple second page image segments of the target page, and stopping the processing of sliding the target page for the preset distance if the sliding times reach a preset threshold value or the target page slides to the bottom of the target page; returning the plurality of first page image segments and the plurality of second impression image segments;
and when the plurality of first page image fragments and the plurality of second page image fragments returned by the tested terminal are received, respectively splicing the plurality of first page image fragments and the plurality of second page image fragments to obtain a first page image and a second page image.
4. The method according to any one of claims 2 or 3, wherein the stitching the plurality of first page image segments and the plurality of second page image segments to obtain a first page image and a second page image respectively comprises:
and respectively carrying out duplication removal processing on the plurality of first page image fragments and the plurality of second page image fragments, and respectively splicing the plurality of first page image fragments and the plurality of second page image fragments subjected to duplication removal processing to obtain the first page image and the second page image.
5. The method according to claim 1, wherein the dividing the first page image and the second page image into a plurality of first function module images and a plurality of second function module images, respectively, comprises:
determining the type of the target page, wherein the type comprises an H5 page type and a native page type, a division line is arranged between a plurality of function module images in a page image of a page of the H5 page type, and a gray bar is arranged between a plurality of function module images in a page image of a page of the native page type;
if the target page belongs to the H5 page type, dividing the first page image and the second page image into a plurality of first function module images and a plurality of second function module images respectively based on dividing lines in the first page image and the second page image;
and if the target page belongs to a native page type, respectively dividing the first page image and the second page image into a plurality of first functional module images and a plurality of second functional module images based on the gray bars in the first page image and the second page image.
6. The method of claim 1, wherein comparing the plurality of first function module images with the plurality of second function module images to obtain a comparison result comprises:
for each first function module image, comparing the first function module image with each second function module image respectively to obtain a plurality of similarity thresholds, and if the similarity thresholds are smaller than a preset similarity threshold, determining that the first function module image is a newly added function module image;
and if the maximum similarity threshold value in the similarity threshold values is larger than the preset similarity threshold value, determining that the second function module image corresponding to the maximum similarity threshold value is matched with the first function module image, and comparing the details of the matched first function module image with the details of the second function module image to obtain the position information of the distinguished area.
7. The method according to claim 6, wherein the comparing the details of the matched first functional module image and the second functional module image to obtain the position information of the distinct region comprises:
performing pixel value difference processing on the matched first functional module image and the second functional module image to obtain a difference image, and performing corrosion processing and expansion processing on the difference image;
based on the pixel values, position information of the distinguishing region in the difference image after the erosion processing and the expansion processing is determined.
8. The method according to any one of claims 6 or 7, wherein after obtaining the position information of the distinct region, the method further comprises:
and marking the distinguishing region in the matched first function module image and/or second function module image based on the position information of the distinguishing region.
9. The method of claim 1, further comprising:
and generating a detection report based on the comparison result and the detection report template.
10. An apparatus for page display testing, the apparatus comprising:
the device comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring a first page image and a second page image, and the first page image and the second page image are images of target pages of application programs with different versions;
a dividing module, configured to divide the first page image and the second page image into a plurality of first function module images and a plurality of second function module images, where the first function module image and the second function module image are images corresponding to contents of the same theme in the first page image and the second page image, respectively, and a boundary marker is provided between two adjacent first function module images and two adjacent second function module images, where the boundary marker includes at least one of a gray bar and a separation line;
and the comparison module is used for comparing the plurality of first functional module images with the plurality of second functional module images to obtain a comparison result.
11. A terminal, characterized in that the terminal comprises a processor and a memory, the memory having stored therein at least one instruction, the at least one instruction being loaded and executed by the processor to implement the method of page show testing according to any of claims 1 to 9.
12. A computer-readable storage medium having stored therein at least one instruction which is loaded and executed by a processor to implement a method of page reveal testing according to any one of claims 1 to 9.
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 CN110532188A (en) 2019-12-03
CN110532188B true 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)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN112732398B (en) * 2021-02-02 2021-08-20 三盟科技股份有限公司 Big data visualization management method and system based on artificial intelligence

Citations (5)

* 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
CN105095083A (en) * 2015-08-24 2015-11-25 上海斐讯数据通信技术有限公司 Mobile phone interface screenshot test method and device used in Android system
CN108764352A (en) * 2018-05-25 2018-11-06 百度在线网络技术(北京)有限公司 Duplicate pages content detection algorithm and device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9298450B2 (en) * 2013-10-25 2016-03-29 International Business Machines Corporation Associating a visualization of user interface with source code
US9465917B2 (en) * 2014-05-30 2016-10-11 Roche Diabetes Care, Inc. Hazard based assessment patterns
CN104978270A (en) * 2015-07-03 2015-10-14 上海触乐信息科技有限公司 Automatic software testing method and apparatus
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
CN107633237B (en) * 2017-09-30 2020-05-29 北京金山安全软件有限公司 Image background segmentation method, device, equipment and medium
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

Patent Citations (5)

* 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
CN105095083A (en) * 2015-08-24 2015-11-25 上海斐讯数据通信技术有限公司 Mobile phone interface screenshot test method and device used in Android system
CN108764352A (en) * 2018-05-25 2018-11-06 百度在线网络技术(北京)有限公司 Duplicate pages content detection algorithm and device

Also Published As

Publication number Publication date
CN110532188A (en) 2019-12-03

Similar Documents

Publication Publication Date Title
CN110532188B (en) Page display test method and device
CN109829456B (en) Image identification method and device and terminal
CN110308956B (en) Application interface display method and device and mobile terminal
CN110798790B (en) Microphone abnormality detection method, device and storage medium
CN111752817A (en) Method, device and equipment for determining page loading duration and storage medium
CN108132790B (en) Method, apparatus and computer storage medium for detecting a garbage code
CN110442521B (en) Control unit detection method and device
CN110795019A (en) Key identification method and device of soft keyboard and storage medium
CN112256320A (en) Version number generation method, device, terminal and storage medium
CN113627413A (en) Data labeling method, image comparison method and device
CN111754386A (en) Image area shielding method, device, equipment and storage medium
CN110784370A (en) Method and device for testing equipment, electronic equipment and medium
CN112052167A (en) Method and device for generating test script code
CN111857793B (en) Training method, device, equipment and storage medium of network model
CN109189290B (en) Click area identification method and device and computer readable storage medium
CN111586279B (en) Method, device and equipment for determining shooting state and storage medium
CN111459466A (en) Code generation method, device, equipment and storage medium
CN111753606A (en) Intelligent model upgrading method and device
CN110399246B (en) Program repair method and device
CN110263695B (en) Face position acquisition method and device, electronic equipment and storage medium
CN109634872B (en) Application testing method, device, terminal and storage medium
CN111797017A (en) Method and device for storing log, test equipment and storage medium
CN111241869A (en) Method and device for checking materials and computer readable storage medium
CN115220632A (en) Method, device, equipment and medium for determining reaction speed of point reading equipment
CN113256656A (en) Image segmentation method and device

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