CN108446227A - A kind of virtual machine browser compatibility test method based on selenium - Google Patents

A kind of virtual machine browser compatibility test method based on selenium Download PDF

Info

Publication number
CN108446227A
CN108446227A CN201810199256.8A CN201810199256A CN108446227A CN 108446227 A CN108446227 A CN 108446227A CN 201810199256 A CN201810199256 A CN 201810199256A CN 108446227 A CN108446227 A CN 108446227A
Authority
CN
China
Prior art keywords
measured
browser
virtual machine
selenium
page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810199256.8A
Other languages
Chinese (zh)
Inventor
梁徽
杨燕清
江洁
郭俊杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Ruijiang Cloud Computing Co Ltd
Guangdong Eflycloud Computing Co Ltd
Original Assignee
Guangdong Ruijiang Cloud Computing 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 Guangdong Ruijiang Cloud Computing Co Ltd filed Critical Guangdong Ruijiang Cloud Computing Co Ltd
Priority to CN201810199256.8A priority Critical patent/CN108446227A/en
Publication of CN108446227A publication Critical patent/CN108446227A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • 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
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The purpose of the disclosure is in view of the deficiencies of the prior art, a kind of virtual machine browser compatibility test method based on selenium is provided, selenium test scripts and standard sectional drawing are initialised in virtual machine to be measured, Run Script obtains the sectional drawing set to be measured of browser to be measured, it is compared successively according to the progress of the respective page of the standard sectional drawing subgraph all with sectional drawing set to be measured, the compatibility similarity set for obtaining virtual machine browser judges each virtual machine browser compatibility successively according to compatible similarity set.The present invention is compared the page of each browser by way of automation, quickly navigates to the page of browser compatibility difference, reduces tester's operation difficulty, and save the plenty of time, greatly improves automatic test success rate and efficiency.

Description

A kind of virtual machine browser compatibility test method based on selenium
Technical field
This disclosure relates to automatic test field, specifically a kind of virtual machine browser compatibility based on selenium is surveyed Method for testing.
Background technology
Compatibility test method needs a large amount of programing work, although there is UI (user interface), user only needs Software is can be operated by intuitive button or other visual elements.But the appearance of UI does not offer convenience to programmer, people There is still a need for realizing corresponding function by code.If different software is allowed to cooperate, similarly to carry out generation Code calls.In the prior art, UI layers of automated test tool is very more, and that compare mainstream is QTP, Robot Framework etc..QTP is the automated test tool of a commercialization, and powerful recording and playback function allows tester can It is easier to realize Web automatic tests, but the script of recording out is very huge, it is subsidiary other than a Script file A large amount of page object, maintenance difficulties are big, reset that mortality is high, and web under the rendering of different browsers may result in page Situations such as face walks, the usage experience of extreme influence user, so the compatibility for carrying out various browsers to web is needed to survey Examination.Robot Framework be a kind of automated test frame of the expansible crucial word drive based on Python carry out Web from Dynamicization is tested, and lacks a unified management for the page object on Web, identical page object location information appears in more In a test case, when page object location information changes, it is necessary to change relevant test case, maintenance work one by one It measures bigger.
Selenium is a tool for web application test.Selenium tests run directly in browser In, just as real user in operation.The browser of support includes (7,8,9,10,11) IE, Mozilla Firefox, Safari, Google Chrome, Opera etc..The major function of this tool includes:The compatibility test of test and browser Your application program see whether can be fine be operated on different browsers and operating system.Test system function creates back Return test verification software function and user demand.Support automatic recording action and the different languages such as automatically generate .Net, Java, Perl The test script of speech.Selenium tests are directly run in a browser, just as being done real user.Selenium is surveyed Examination can be run in Internet Explorer, Chrome and the Firefox on Windows, Linux and Macintosh. Other testing tools cannot all cover so many platform.Using selenium and in a browser testing results also have it is many its His benefit.By write imitate user's operation selenium test scripts, wherein webdriver components be one be used for into The tool of the complicated web automatic tests repeated of row, can carry out test application program from the angle of terminal user.By in difference Testing results in browser, it is easier to find the incompatibility of browser.In addition, in the prior art, browser-safe at present Property most of test compared by manually directly opening multiple browsers, multiple browsers are opened simultaneously in computer, with matrix Mode carry out arrangement compared, due to browser Numerous, some browser versions even up to tens, browser Rendering different may cause walk Deng compatibility issues to web page, it is therefore desirable to compatible survey is carried out to big browser Examination, manual test will open simultaneously multiple browsers and carry out page comparison, and computer operation can become slow, and manually check one by one The each page of browser then needs to expend very more time, and efficiency is relatively low and easy error.
Invention content
The purpose of the disclosure be in view of the deficiencies of the prior art, provide it is a kind of improve automatic test efficiency based on browsing The virtual machine compatibility test method of device compatibility is convenient for unified management, reduces the workload that script is safeguarded.
To achieve the goals above, the disclosure proposes a kind of virtual machine browser compatibility test side based on selenium Method specifically includes following steps:
Step 1, selenium test scripts A1 and standard sectional drawing A2 are initialised in virtual machine to be measured;
Step 2, operation A1 obtains the sectional drawing set A3 to be measured of browser to be measured;
Step 3, A1 is compared successively according to the progress of the respective page of subgraphs all A2 and A3, obtains virtual machine browser Compatibility similarity set A4;
Step 4, judge each virtual machine browser compatibility successively according to A4.
Further, in step 1, selenium test scripts A1 includes at least webdriver components (webdriver Component is a tool for being used for carrying out the complicated web automatic tests repeated), page elements are positioned, and certainly by script Dynamic to click, the modes such as dragging obtain the required browser page tested and to each page screenshots to be measured.
Further, in step 1, the method for obtaining standard sectional drawing A2 includes following sub-step:
Step 1.1, pass through the full frame opening standard browsers of selenium test scripts A1;
Step 1.2, A1 opens each page of standard browser to the positioning of its page elements;
Step 1.3, A1 obtains standard sectional drawing A2 to page screenshot after being positioned to page elements.
Further, in step 1, browser and version to be tested are determined as needed, are accordingly pacified in virtual machine If there are many browser number to be tested the multiple virtual machines of installation may be selected, then install browser respectively in dress.
Further, in step 2, the method that operation A1 obtains sectional drawing set A3 to be measured to be measured includes following sub-step Suddenly:
Step 2.1, pass through the selenium test scripts A1 successively full frame all browsings to be measured opened in virtual machine to be measured Device;
Step 2.2, A1 opens each page to be measured of each browser to be measured to the positioning of its page elements successively;
Step 2.3, A1 obtains each page screenshot to be measured all sectional drawing set A3 to be measured after being positioned to page elements.
Further, in step 3, selenium test scripts A1 waits for standard sectional drawing A2 with other browsers one by one It surveys respective page in sectional drawing set A3 and carries out similarity comparison, compatible similarity set A4 is carried out ascending order row after the completion of comparison Row.
Further, in step 3, the compatibility similarity set A4 methods that A1 obtains virtual machine browser include following son Step:
Step 3.1, standard sectional drawing A2 and sectional drawing set A3 to be measured are scaled 8 × 9 sizes by selenium test scripts A1 Scaling figure S1, Plays sectional drawing A2 generates standard zoom figure S1, sectional drawing set A3 to be measured and generates scaling set of graphs S2 to be measured;
Step 3.2, standard zoom figure S1 is converted to the standard grayscale figure S3 of 256 ranks, scaling set of graphs S2 conversions to be measured For the gray scale set of graphs S4 to be measured of 256 ranks;
Step 3.3, the picture element matrix of standard grayscale figure S3 is compared line by line, previous pixel value is more than or equal to the latter picture Plain value is denoted as 1, less than being denoted as 0, the normal data sequence S5 of one 1 and 0 composition is generated, by each son of gray scale set of graphs S4 to be measured The picture element matrix of figure compares line by line successively, and previous pixel value is denoted as 1 more than or equal to the latter pixel value, less than being denoted as 0, generates One 1 and the 0 normal data sequence that constitutes, each data sequence of generation combine by comparison sequence and generate testing data sequence Set S6, wherein the data sequence totally 8 row 64, often row have 9 pixels, 8 differences;
Step 3.4, each subdata sequence of testing data arrangement set S6 is carried out with normal data sequence S5 successively Comparison, how many position of element for calculating two 64 corresponding with S5 of subdata sequence successively are different, that is, calculate two Comparing result is generated the compatibility similarity set A4 of virtual machine browser by the number of the different elements of sequence corresponding position, In, comparing result value range 0 to 100.
Further, in step 4, judge that the method for each virtual machine browser compatibility includes following successively according to A4 Sub-step:
Step 4.1, selenium test scripts A1 passes through more each browser of difference hash algorithm page to be measured and standard The similarity of browser same page subtracts each element numerical generation similarity in compatible similarity set A4 with 100 successively Ordered series of numbers R1, the element in R1 are similarity value, judge the similarity value of R1 successively, and similarity value is denoted as 0 less than 20, similar - 1 is denoted as between angle value 20~30, similarity value is denoted as 1 more than 30, generates test result array R2;
Step 4.2, each test result element in test result array R2 is determined as if test result element is 0 successively Similar pictures illustrate that the corresponding browser compatibility to be measured of array number is good, if test result element is 1, are determined as dissmilarity Picture illustrates that the corresponding browser compatibility to be measured of array number is poor, if test result element is -1, illustrates that array number corresponds to Browser compatibility to be measured it is general.
The disclosure has the beneficial effect that:The present invention is compared the page of each browser by way of automation, soon Speed navigates to the page of browser compatibility difference, reduces tester's operation difficulty, and save the plenty of time, greatly improves Automatic test success rate and efficiency.
Description of the drawings
By the way that the embodiment in conjunction with shown by attached drawing is described in detail, above-mentioned and other features of the disclosure will More obvious, identical reference label indicates same or analogous element in disclosure attached drawing, it should be apparent that, in being described below Attached drawing be only some embodiments of the present disclosure, for those of ordinary skill in the art, do not making the creative labor Under the premise of, other drawings may also be obtained based on these drawings, in the accompanying drawings:
Fig. 1 show a kind of flow of virtual machine browser compatibility test method based on selenium of the disclosure Figure;
Fig. 2 show a kind of test pictures similarity flow chart of the disclosure.
Specific implementation mode
The technique effect of the design of the disclosure, concrete structure and generation is carried out below with reference to embodiment and attached drawing clear Chu, complete description, to be completely understood by the purpose, scheme and effect of the disclosure.It should be noted that the case where not conflicting Under, the features in the embodiments and the embodiments of the present application can be combined with each other.The identical attached drawing mark used everywhere in attached drawing Note indicates same or analogous part.
As shown in Figure 1 for according to a kind of virtual machine browser compatibility test method based on selenium of the disclosure Flow chart illustrates a kind of virtual machine browser compatibility based on selenium according to embodiment of the present disclosure in conjunction with Fig. 1 Property test method.
The disclosure proposes a kind of virtual machine browser compatibility test method based on selenium, specifically includes following step Suddenly:
Step 1, selenium test scripts A1 and standard sectional drawing A2 are initialised in virtual machine to be measured;
Step 2, operation A1 obtains the sectional drawing set A3 to be measured of browser to be measured;
Step 3, A1 is compared successively according to the progress of the respective page of subgraphs all A2 and A3, obtains virtual machine browser Compatibility similarity set A4;
Step 4, judge each virtual machine browser compatibility successively according to A4.
In step 1, including at least webdriver components, (webdriver components are one to selenium test scripts A1 For carrying out the tool of the complicated web automatic tests repeated), page elements are positioned, and by script automatically clicking, pulls Etc. modes obtain needed for test browser page and to each page screenshot to be measured.A common browser is chosen as mark Standard carries out the artificial page to webpage to be tested and tests, find out all page problems, and transfer to development process, until place Reason finishes, and the method for obtaining standard sectional drawing A2 includes following sub-step:
Step 1.1, pass through the full frame opening standard browsers of selenium test scripts A1;
Step 1.2, A1 opens each page of standard browser to the positioning of its page elements;
Step 1.3, A1 obtains standard sectional drawing A2 to page screenshot after being positioned to page elements.
In step 1, browser and version to be tested are determined as needed, are accordingly installed in virtual machine, if to be measured It is many to try browser number, the multiple virtual machines of installation may be selected, then browser is installed respectively.
In step 2, the webdriver components of selenium directly can carry out operation to browser and write python Script opens standard browser by selenium, and browser is full frame, and browser full frameization is to keep sectional drawing In only include the content of web, prevent the interface of browser itself from being interfered to the comparison of sectional drawing, second is that sectional drawing size complete one Sample could subsequently compare.Then web page to be tested is opened by selenium, then fixed to page elements by selenium Position, and can click, dragging etc. obtains the required page tested, and then calls the driver.get_ in webdriver components The method of screenshot_as_file () carries out sectional drawing preservation, the name format of sectional drawing file is ' browser version number+cut The number of figure sequence ', sectional drawing is stored in same file folder.Operation A1 obtains the method packet of sectional drawing set A3 to be measured to be measured Include following sub-step:
Step 2.1, pass through the selenium test scripts A1 successively full frame all browsings to be measured opened in virtual machine to be measured Device;
Step 2.2, A1 opens each page to be measured of each browser to be measured to the positioning of its page elements successively;
Step 2.3, A1 obtains each page screenshot to be measured all sectional drawing set A3 to be measured after being positioned to page elements.
In step 3, selenium test scripts A1 by standard sectional drawing A2 one by one with the sectional drawing collection to be measured of other browsers It closes respective page in A3 and carries out similarity comparison, compatible similarity set A4 is carried out ascending order arrangement after the completion of comparison.
In step 3, the compatibility similarity set A4 methods that A1 obtains virtual machine browser include following sub-step:
Step 3.1, standard sectional drawing A2 and sectional drawing set A3 to be measured are scaled 8 × 9 sizes by selenium test scripts A1 Scaling figure S1, Plays sectional drawing A2 generates standard zoom figure S1, sectional drawing set A3 to be measured and generates scaling set of graphs S2 to be measured;
Step 3.2, standard zoom figure S1 is converted to the standard grayscale figure S3 of 256 ranks, scaling set of graphs S2 conversions to be measured For the gray scale set of graphs S4 to be measured of 256 ranks;
Step 3.3, the picture element matrix of standard grayscale figure S3 is compared line by line, previous pixel value is more than or equal to the latter picture Plain value is denoted as 1, less than being denoted as 0, the normal data sequence S5 of one 1 and 0 composition is generated, by each son of gray scale set of graphs S4 to be measured The picture element matrix of figure compares line by line successively, and previous pixel value is denoted as 1 more than or equal to the latter pixel value, less than being denoted as 0, generates One 1 and the 0 normal data sequence that constitutes, each data sequence of generation combine by comparison sequence and generate testing data sequence Set S6, wherein the data sequence totally 8 row 64, often row have 9 pixels, 8 differences;
Step 3.4, each subdata sequence of testing data arrangement set S6 is carried out with normal data sequence S5 successively Comparison, how many position of element for calculating two 64 corresponding with S5 of subdata sequence successively are different, that is, calculate two Comparing result is generated the compatibility similarity set A4 of virtual machine browser by the number of the different elements of sequence corresponding position, In, comparing result value range 0 to 100.
In step 4, script passes through more each browser of difference hash algorithm page to be measured and standard browser same page The similarity in face.The page of standard browser carries out similarity comparison with the respective page of other browsers one by one, obtains similar The value of degree;It is finished until the page of all standard browsers all compares.Finally obtain all test pages of all browsers and mark Similarity is carried out ascending order arrangement by the similarity of quasi- browser.Difference hash algorithm by picture fingerprint it is worth go out two figure The similarity of piece, value range 0 to 100 can be higher according to similarity, tentatively judges the good of browser page compatibility to be measured It is bad, judge that the method for each virtual machine browser compatibility includes following sub-step successively according to A4:
Step 4.1, selenium test scripts A1 passes through more each browser of difference hash algorithm page to be measured and standard The similarity of browser same page subtracts each element numerical generation similarity in compatible similarity set A4 with 100 successively Ordered series of numbers R1, the element in R1 are similarity value, judge the similarity value of R1 successively, and similarity value is denoted as 0 less than 20, similar - 1 is denoted as between angle value 20~30, similarity value is denoted as 1 more than 30, generates test result array R2;
Step 4.2, each test result element in test result array R2 is determined as if test result element is 0 successively Similar pictures illustrate that the corresponding browser compatibility to be measured of array number is good, if test result element is 1, are determined as dissmilarity Picture illustrates that the corresponding browser compatibility to be measured of array number is poor, if test result element is -1, illustrates that array number corresponds to Browser compatibility to be measured it is general.
A kind of virtual machine browser compatibility test system based on selenium that embodiment of the disclosure provides, the reality A kind of virtual machine browser compatibility test system based on selenium for applying example includes:Processor, memory and storage In the memory and the computer program that can run on the processor, such as encipheror.The processor executes The step in above-mentioned each encryption method embodiment, such as one of the disclosure shown in FIG. 1 are realized when the computer program The step of flow chart of the automated testing method of embodiment.It is following to execute that the processor executes the computer program Step, steps are as follows:
Step 1, selenium test scripts A1 and standard sectional drawing A2 are initialised in virtual machine to be measured;
Step 2, operation A1 obtains the sectional drawing set A3 to be measured of browser to be measured;
Step 3, A1 is compared successively according to the progress of the respective page of subgraphs all A2 and A3, obtains virtual machine browser Compatibility similarity set A4;
Step 4, judge each virtual machine browser compatibility successively according to A4.
A kind of virtual machine browser compatibility test system based on selenium that embodiment of the disclosure provides, wherein One specific embodiment step is:
Step (1) determines browser and version to be tested, is accordingly installed in virtual machine, if to be tested as needed There are many browser number, the multiple virtual machines of installation may be selected, then install browser respectively.
Step (2) chooses a common browser as standard, carries out the artificial page to webpage to be tested and survey Examination, finds out all page problems, and transfer to development process, until being disposed.
Step (3), the webdriver components of selenium directly can carry out operation to browser and write python feet This opens standard browser, and browser is full frame by selenium, and browser full frameization is to keep in sectional drawing The content for only including web, prevents the interface of browser itself from being interfered to the comparison of sectional drawing, second is that sectional drawing size is just the same Could subsequently it compare.Then web page to be tested is opened by selenium, then fixed to page elements by selenium Position, and can click, dragging etc. obtains the required page tested, and then calls the driver.get_ in webdriver components The method of screenshot_as_file () carries out sectional drawing preservation, the name format of sectional drawing file is ' browser version number+cut The number of figure sequence ', sectional drawing is stored in same file folder.
Step (4), the script of invocation step (3) similarly operate other browsers to be tested, each browser Acquired sectional drawing is all stored in the same order in the file that step (3) is created.
Step (5), script pass through more each browser of difference hash algorithm page to be measured and standard browser same page Similarity.The page of standard browser carries out similarity comparison with the respective page of other browsers one by one, obtains similarity Value;It is finished until the page of all standard browsers all compares.Finally obtain all test pages of all browsers and standard Similarity is carried out ascending order arrangement by the similarity of browser.Difference hash algorithm by picture fingerprint it is worth go out two pictures Similarity, value range 0 to 100 can be higher according to similarity, tentatively judges the good of the browser page to be measured compatibility It is bad, it is illustrated in figure 2 a kind of test pictures similarity flow chart of the disclosure, the implementation according to the disclosure is illustrated in conjunction with Fig. 2 The similarity based method of the picture of mode, steps are as follows:
A. it scales:Picture is scaled 8*9, retains structure, details of going out.
B. gray processing:Be converted to 256 rank gray-scale maps.
C. it averages:Calculate the average value of gray-scale map all pixels.
D. pixel compares:First pixel value is compared with the average value of pixel, and since second pixel value, pixel value is big It is denoted as 1 in the latter pixel value, is denoted as 0 on the contrary.One's own profession is not compared with next line, and often 9 pixels of row, eight differences have 8 rows, 64 in total.
E. hash is generated:By above-mentioned steps generate 1 and 0 combine in order be both picture fingerprint (hash).It is suitable Sequence is not fixed.But it when comparing must be identical sequence.
F. fingerprint is compared:The fingerprint of two width figures is compared, calculates Hamming distance, i.e., two 64 hash values are how many position It is different, differs that digit is fewer, and picture is more similar.
G. similarity judges:The numerical value that step f is obtained is smaller, indicates that picture is more similar.Finally step f institutes are subtracted with 100 Numerical value is obtained as similarity, similarity is bigger, indicates that picture is more similar.
Step (6), step (5) obtain similarity of all sectional drawings compared with standard browser and have arranged sequence. Rule of thumb, the quality that similarity value can distinguish compatibility well as 20 is set, sectional drawing of the similarity less than 20 is transferred to develop Personnel repair the browser page of poor compatibility.
A kind of virtual machine browser compatibility test method based on selenium can run on desktop calculating In the computing devices such as machine, notebook, palm PC and cloud server.A kind of virtual machine browser based on selenium The device that compatibility test method can be run may include, but be not limited only to, processor, memory.Those skilled in the art can be with Understand, the example is only a kind of example of the virtual machine browser compatibility test method based on selenium, not structure A kind of pairs of restriction of the virtual machine browser compatibility test method based on selenium may include more than example or more Few component either combines certain components or different components, such as a kind of virtual machine browsing based on selenium Device compatibility test method can also include input-output equipment, network access equipment, bus etc..
Alleged processor can be central processing unit (Central Processing Unit, CPU), can also be it His general processor, digital signal processor (Digital Signal Processor, DSP), application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor can also be any conventional processor Deng the processor is a kind of control of virtual machine browser compatibility test method running gear based on selenium Center, using various interfaces and connection, entirely a kind of virtual machine browser compatibility test method based on selenium can The various pieces of running gear.
The memory can be used for storing the computer program and/or module, and the processor is by running or executing Computer program in the memory and/or module are stored, and calls the data being stored in memory, described in realization A kind of various functions of the virtual machine browser compatibility test method based on selenium.The memory can include mainly depositing Store up program area and storage data field, wherein storing program area can storage program area, the application program needed at least one function (such as sound-playing function, image player function etc.) etc.;Storage data field can be stored uses created number according to mobile phone According to (such as audio data, phone directory etc.) etc..In addition, memory may include high-speed random access memory, can also include Nonvolatile memory, such as hard disk, memory, plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), safety Digital (Secure Digital, SD) card, flash card (Flash Card), at least one disk memory, flush memory device or Other volatile solid-state parts.
Although the description of the disclosure is quite detailed and especially several embodiments are described, it is not Any of these details or embodiment or any specific embodiments are intended to be limited to, but it is by reference to appended that should be considered as Claim considers that the prior art provides the possibility explanation of broad sense for these claims, to effectively cover the disclosure Preset range.In addition, the disclosure is described with inventor's foreseeable embodiment above, its purpose is to be provided with Description, and those equivalent modifications that the disclosure can be still represented to the unsubstantiality change of the disclosure still unforeseen at present.

Claims (8)

1. a kind of virtual machine browser compatibility test method based on selenium, which is characterized in that the compatibility test Method includes the following steps:
Step 1, selenium test scripts A1 and standard sectional drawing A2 are initialised in virtual machine to be measured;
Step 2, operation A1 obtains the sectional drawing set A3 to be measured of browser to be measured;
Step 3, A1 is compared successively according to the progress of the respective page of subgraphs all A2 and A3, obtains the simultaneous of virtual machine browser Hold similarity set A4;
Step 4, judge each virtual machine browser compatibility successively according to A4.
2. a kind of virtual machine browser compatibility test method based on selenium according to claim 1, feature It is, in step 1, selenium test scripts A1 includes at least webdriver components, is positioned to page elements, and pass through Script automatically clicking is with the browser page tested needed for pulling mode acquisition and to each page screenshot to be measured.
3. a kind of virtual machine browser compatibility test method based on selenium according to claim 1, feature It is, in step 1, the method for obtaining standard sectional drawing A2 includes following sub-step:
Step 1.1, pass through the full frame opening standard browsers of selenium test scripts A1;
Step 1.2, A1 opens each page of standard browser to the positioning of its page elements;
Step 1.3, A1 obtains standard sectional drawing A2 to page screenshot after being positioned to page elements.
4. a kind of virtual machine browser compatibility test method based on selenium according to claim 1, feature It is, in step 2, the method that operation A1 obtains sectional drawing set A3 to be measured to be measured includes following sub-step:
Step 2.1, pass through the selenium test scripts A1 successively full frame all browsers to be measured opened in virtual machine to be measured;
Step 2.2, A1 opens each page to be measured of each browser to be measured to the positioning of its page elements successively;
Step 2.3, A1 obtains each page screenshot to be measured all sectional drawing set A3 to be measured after being positioned to page elements.
5. a kind of virtual machine browser compatibility test method based on selenium according to claim 1, feature Be, in step 3, selenium test scripts A1 by standard sectional drawing A2 one by one with the sectional drawing set A3 to be measured of other browsers Middle respective page carries out similarity comparison, and compatible similarity set A4 is carried out ascending order arrangement after the completion of comparison.
6. a kind of virtual machine browser compatibility test method based on selenium according to claim 1, feature It is, in step 3, the compatibility similarity set A4 methods that A1 obtains virtual machine browser include following sub-step:
Step 3.1, standard sectional drawing A2 and sectional drawing set A3 to be measured are scaled the contracting of 8 × 9 sizes by selenium test scripts A1 Figure S1 is put, Plays sectional drawing A2 generates standard zoom figure S1, sectional drawing set A3 to be measured and generates scaling set of graphs S2 to be measured;
Step 3.2, standard grayscale the figure S3, scaling set of graphs S2 to be measured for standard zoom figure S1 being converted to 256 ranks are converted to 256 The gray scale set of graphs S4 to be measured of rank;
Step 3.3, the picture element matrix of standard grayscale figure S3 is compared line by line, previous pixel value is more than or equal to the latter pixel value It is denoted as 1, less than being denoted as 0, the normal data sequence S5 of one 1 and 0 composition are generated, by each subgraph of gray scale set of graphs S4 to be measured Picture element matrix compares line by line successively, and previous pixel value is denoted as 1 more than or equal to the latter pixel value, less than being denoted as 0, generates one The 1 and 0 normal data sequence constituted, each data sequence of generation combines by comparison sequence generates testing data arrangement set S6, wherein the data sequence totally 8 row 64, often row have 9 pixels, 8 differences;
Step 3.4, each subdata sequence of testing data arrangement set S6 is compared with normal data sequence S5 successively, The number of the different elements of two sequence corresponding positions is calculated successively, and the compatibility that comparing result is generated to virtual machine browser is similar Spend set A4, wherein comparing result value range 0 to 100.
7. a kind of virtual machine browser compatibility test method based on selenium according to claim 1, feature It is, in step 4, judges that the method for each virtual machine browser compatibility includes following sub-step successively according to A4:
Step 4.1, selenium test scripts A1 passes through more each browser of difference hash algorithm page to be measured and standard browser Element of the similarity of device same page in R1 is similarity value, judges that the similarity value of R1, similarity value are less than successively 20 are denoted as 0, and -1 is denoted as between similarity value 20~30, and similarity value is denoted as 1 more than 30, generates test result array R2;
Step 4.2, each test result element in test result array R2 is determined as similar if test result element is 0 successively Picture is determined as dissimilar picture if test result element is 1, if test result element is -1, illustrates that array number is corresponding Browser compatibility to be measured is general.
8. a kind of virtual machine browser compatibility test method system based on selenium, which is characterized in that the system packet It includes:Memory, processor and it is stored in the computer program that can be run in the memory and on the processor, it is special Sign is that the processor executes the computer program to execute following steps:
Step 1, selenium test scripts A1 and standard sectional drawing A2 are initialised in virtual machine to be measured;
Step 2, operation A1 obtains the sectional drawing set A3 to be measured of browser to be measured;
Step 3, A1 is compared successively according to the progress of the respective page of subgraphs all A2 and A3, obtains the simultaneous of virtual machine browser Hold similarity set A4;
Step 4, judge each virtual machine browser compatibility successively according to A4.
CN201810199256.8A 2018-03-12 2018-03-12 A kind of virtual machine browser compatibility test method based on selenium Pending CN108446227A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810199256.8A CN108446227A (en) 2018-03-12 2018-03-12 A kind of virtual machine browser compatibility test method based on selenium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810199256.8A CN108446227A (en) 2018-03-12 2018-03-12 A kind of virtual machine browser compatibility test method based on selenium

Publications (1)

Publication Number Publication Date
CN108446227A true CN108446227A (en) 2018-08-24

Family

ID=63193990

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810199256.8A Pending CN108446227A (en) 2018-03-12 2018-03-12 A kind of virtual machine browser compatibility test method based on selenium

Country Status (1)

Country Link
CN (1) CN108446227A (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109901968A (en) * 2019-01-31 2019-06-18 阿里巴巴集团控股有限公司 A kind of automation page data method of calibration and device
CN110704669A (en) * 2019-10-16 2020-01-17 紫光云技术有限公司 Resolution compatibility test image analysis method
CN110716778A (en) * 2019-09-10 2020-01-21 阿里巴巴集团控股有限公司 Application compatibility testing method, device and system
CN110825651A (en) * 2019-12-11 2020-02-21 北京海益同展信息科技有限公司 Webpage compatibility testing method, device, system and storage medium
CN111309618A (en) * 2020-02-24 2020-06-19 广州市百果园信息技术有限公司 Page element positioning method, page testing method and related device
CN111581091A (en) * 2020-04-30 2020-08-25 北京字节跳动网络技术有限公司 Page testing method and device, readable medium and electronic equipment
CN112528115A (en) * 2019-09-17 2021-03-19 中国移动通信集团安徽有限公司 Website monitoring method and device
CN113238942A (en) * 2021-05-13 2021-08-10 京东数字科技控股股份有限公司 User interface testing method and device, electronic equipment and storage medium
CN113238959A (en) * 2021-06-03 2021-08-10 上海中通吉网络技术有限公司 Browser page compatibility detection method
CN113282502A (en) * 2021-06-04 2021-08-20 青岛海尔科技有限公司 Script generation method, device, storage medium and electronic device
CN113467864A (en) * 2020-03-31 2021-10-01 福建天泉教育科技有限公司 Mobile terminal H5 user interface adaptation test method and system thereof
CN113506291A (en) * 2021-07-29 2021-10-15 上海幻电信息科技有限公司 Compatibility testing method and device
CN113660535A (en) * 2021-08-18 2021-11-16 海看网络科技(山东)股份有限公司 System and method for monitoring content change of EPG column of IPTV service

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103927253A (en) * 2013-01-11 2014-07-16 阿里巴巴集团控股有限公司 Multiple browser compatibility testing method and system
CN106411633A (en) * 2016-08-23 2017-02-15 国家电网公司 Web application compatibility testing method based on openstack and system thereof
US9628805B2 (en) * 2014-05-20 2017-04-18 AVAST Software s.r.o. Tunable multi-part perceptual image hashing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103927253A (en) * 2013-01-11 2014-07-16 阿里巴巴集团控股有限公司 Multiple browser compatibility testing method and system
US9628805B2 (en) * 2014-05-20 2017-04-18 AVAST Software s.r.o. Tunable multi-part perceptual image hashing
CN106411633A (en) * 2016-08-23 2017-02-15 国家电网公司 Web application compatibility testing method based on openstack and system thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄嘉恒: "基于哈希的图像相似度算法比较研究", 《大理大学学报》 *

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109901968A (en) * 2019-01-31 2019-06-18 阿里巴巴集团控股有限公司 A kind of automation page data method of calibration and device
CN110716778A (en) * 2019-09-10 2020-01-21 阿里巴巴集团控股有限公司 Application compatibility testing method, device and system
CN110716778B (en) * 2019-09-10 2023-09-26 创新先进技术有限公司 Application compatibility testing method, device and system
CN112528115A (en) * 2019-09-17 2021-03-19 中国移动通信集团安徽有限公司 Website monitoring method and device
CN110704669A (en) * 2019-10-16 2020-01-17 紫光云技术有限公司 Resolution compatibility test image analysis method
CN110825651A (en) * 2019-12-11 2020-02-21 北京海益同展信息科技有限公司 Webpage compatibility testing method, device, system and storage medium
CN111309618A (en) * 2020-02-24 2020-06-19 广州市百果园信息技术有限公司 Page element positioning method, page testing method and related device
CN113467864A (en) * 2020-03-31 2021-10-01 福建天泉教育科技有限公司 Mobile terminal H5 user interface adaptation test method and system thereof
CN111581091B (en) * 2020-04-30 2023-03-21 北京字节跳动网络技术有限公司 Page testing method and device, readable medium and electronic equipment
CN111581091A (en) * 2020-04-30 2020-08-25 北京字节跳动网络技术有限公司 Page testing method and device, readable medium and electronic equipment
CN113238942A (en) * 2021-05-13 2021-08-10 京东数字科技控股股份有限公司 User interface testing method and device, electronic equipment and storage medium
CN113238959A (en) * 2021-06-03 2021-08-10 上海中通吉网络技术有限公司 Browser page compatibility detection method
CN113282502A (en) * 2021-06-04 2021-08-20 青岛海尔科技有限公司 Script generation method, device, storage medium and electronic device
CN113506291A (en) * 2021-07-29 2021-10-15 上海幻电信息科技有限公司 Compatibility testing method and device
CN113506291B (en) * 2021-07-29 2024-03-26 上海幻电信息科技有限公司 Compatibility testing method and device
CN113660535A (en) * 2021-08-18 2021-11-16 海看网络科技(山东)股份有限公司 System and method for monitoring content change of EPG column of IPTV service

Similar Documents

Publication Publication Date Title
CN108446227A (en) A kind of virtual machine browser compatibility test method based on selenium
US10579344B2 (en) Converting visual diagrams into code
US9563974B2 (en) Aggregating graph structures
CN102520841B (en) Collection user interface
US7703027B2 (en) Merging graphical programs
US8266542B2 (en) Rendering and sorting book search results as three dimensional icons
CN108351828A (en) Technology for device-independent automatic application test
US9064233B2 (en) Methods and apparatus for device-specific analytics data visualization
EP3074863A1 (en) System and method for testing data representation for different mobile devices
CN109471805A (en) Resource testing method and device, storage medium, electronic equipment
CN109299424A (en) It is a kind of to provide the method, apparatus and computer readable medium of response events based on rich text
CN112965645A (en) Page dragging method and device, computer equipment and storage medium
CN113807062A (en) Online drawing method and device for combined density map and electronic equipment
CN112527676A (en) Model automation test method, device and storage medium
CN106371706A (en) Method and device for site selection of application shortcuts
Sharma et al. Machine Learning for OpenCV 4: Intelligent algorithms for building image processing apps using OpenCV 4, Python, and scikit-learn
CN105706023B (en) With the communication for the input equipment that do not support
CN105446785A (en) Method and system for unloading application program
US20160140189A1 (en) User interface and a method for searching a model
CN115292196A (en) User interface testing method and device, electronic equipment and readable storage medium
US20210375154A1 (en) Automatic creation and annotation of software-related instructional videos
CN108334313A (en) Continuous integrating method, apparatus and code management system for large-scale SOC research and development
CN114972788A (en) Outlier extraction method and device of three-dimensional point cloud
Nordan An investigation of potential methods for topology preservation in interactive vector tile map applications
Moore et al. Python GUI Programming-A Complete Reference Guide: Develop responsive and powerful GUI applications with PyQt and Tkinter

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180824