CN112506785A - Automatic testing method, device, equipment and medium for login of Html5 game page - Google Patents

Automatic testing method, device, equipment and medium for login of Html5 game page Download PDF

Info

Publication number
CN112506785A
CN112506785A CN202011484061.1A CN202011484061A CN112506785A CN 112506785 A CN112506785 A CN 112506785A CN 202011484061 A CN202011484061 A CN 202011484061A CN 112506785 A CN112506785 A CN 112506785A
Authority
CN
China
Prior art keywords
test case
browser
test
script
game 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
CN202011484061.1A
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.)
Hangzhou Electronic Soul Network Technology Co Ltd
Original Assignee
Hangzhou Electronic Soul Network 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 Hangzhou Electronic Soul Network Technology Co Ltd filed Critical Hangzhou Electronic Soul Network Technology Co Ltd
Priority to CN202011484061.1A priority Critical patent/CN112506785A/en
Publication of CN112506785A publication Critical patent/CN112506785A/en
Pending legal-status Critical Current

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
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/70Game security or game management aspects
    • A63F13/77Game security or game management aspects involving data related to game devices or game servers, e.g. configuration data, software version or amount of memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • 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/3696Methods or tools to render software testable

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • General Business, Economics & Management (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to an automatic testing method, device, equipment and medium for login of an Html5 game page, and belongs to the field of automatic testing, wherein the method comprises the following steps: loading a driver of a browser needing compatibility test by using a pre-written script; calling a Selenium library through a script to drive each browser and simulate a login request of a user, wherein the simulating of the login request of the user comprises the following steps: automatically opening an Html5 game page with each browser and simulating interaction of each element of an Html5 game page to generate a login request; executing each test case in a pre-constructed test case set under a pre-constructed test case environment, wherein each test case is positioned on each element in advance; and when all the test cases in the test case set are executed, automatically generating a test report. The compatibility test problem is effectively solved, the test efficiency is improved, and the time cost and the labor cost are saved.

Description

Automatic testing method, device, equipment and medium for login of Html5 game page
Technical Field
The application relates to the field of automated testing, in particular to an automatic testing method, device, equipment and medium for login of an Html5 game page.
Background
The development and iteration speed of the requirements are compact for the current Html5 game page. In the case of basic functional testing, the test case covers the whole process of testing, including unit testing, integration testing, system testing, regression testing, and the like. It can be seen that the work content of the function test is more and more for the black box test engineer, however, the work content is not creative operation and the repeatability is high, so that a lot of time and manpower are wasted. Particularly in game projects, the iteration speed is high, the function points to be tested are many, and a large number of test cases are almost impossible to be tested by hands in a short time.
In addition, at present, there are various mainstream browsers in the internet market, and there are various browsers for the young, which can be said to be eight-door-five, and each browser has many versions. Therefore, the method of manually downloading each browser to perform the compatibility test may increase the workload, resulting in more time and labor being wasted.
At present, aiming at solving the problem of compatibility test in the related technology, the test efficiency is improved, the time cost and the labor cost are saved, and an effective solution is not provided.
Disclosure of Invention
The embodiment of the application provides an automatic testing method, device, equipment and medium for login of an Html5 game page, and aims to at least solve the problem of compatibility testing in the related technology and solve the problems of low manual testing efficiency and high time cost and labor cost.
In a first aspect, an embodiment of the present application provides an automatic testing method for Html5 game page login, including: loading a driver of a browser needing compatibility test by using a pre-written script; calling a Selenium library through the script to drive each browser and simulate a login request of a user, wherein the login request of the simulated user comprises: automatically opening an Html5 game page with each said browser and simulating interaction of elements of said Html5 game page to generate a login request; executing each test case in a pre-constructed test case set under a pre-constructed test case environment, wherein each test case is positioned to each element in advance; and when all the test cases in the test case set are completely executed, automatically generating a test report.
In some embodiments, in a case that the test case environment includes a pre-condition and a post-condition, executing each test case in the pre-constructed test case set in the pre-constructed test case environment includes: before executing each test case, opening a browser, maximizing the browser and/or clicking a search button of the browser according to the precondition; and after each test case is executed, closing the browser according to the post condition.
In some embodiments, said locating each of said test cases onto each of said elements comprises: creating a test case according to an equivalence class division method or a boundary value analysis method; and positioning the created test case to the corresponding element.
In some embodiments, in a case that the script is a Python script, loading a driver of a browser requiring a compatibility test by using a pre-written script includes: placing a driving address of a browser needing compatibility testing under a directory of the Python script; and loading the driver of each browser by using the Python script.
In a second aspect, an embodiment of the present application provides an automatic testing apparatus for Html5 game page login, including: the device comprises a loading module, a calling module, an executing module and a generating module, wherein the loading module is used for loading the driver of the browser needing to be subjected to the compatibility test by utilizing a pre-written script; the calling module is used for calling the Selenium library through the script to drive each browser and simulate the login request of the user, wherein the login request of the simulated user comprises: automatically opening an Html5 game page with each said browser and simulating interaction of elements of said Html5 game page to generate a login request; the execution module is used for executing each test case in a pre-constructed test case set under a pre-constructed test case environment, wherein each test case is positioned to each element in advance; the generating module is used for automatically generating a test report when all the test cases in the test case set are executed.
In some embodiments, in a case that the test case environment includes a pre-condition and a post-condition, executing each test case in the pre-constructed test case set in the pre-constructed test case environment includes: before executing each test case, opening a browser, maximizing the browser and/or clicking a search button of the browser according to the precondition; and after each test case is executed, closing the browser according to the post condition.
In some embodiments, said locating each of said test cases onto each of said elements comprises: creating a test case according to an equivalence class division method or a boundary value analysis method; and positioning the created test case to the corresponding element.
In some embodiments, in a case that the script is a Python script, loading a driver of a browser requiring a compatibility test by using a pre-written script includes: placing a driving address of a browser needing compatibility testing under a directory of the Python script; and loading the driver of each browser by using the Python script.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a storage medium storing a computer program, where the computer program, when executed by the processor, implements the automatic testing method for Html5 game page login according to any one of the above items.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, the computer program, when executed by a processor, implementing an automated testing method for Html5 game page login as described in any one of the above.
According to the content, the automatic testing method for the login of the Html5 game page comprises the following steps: loading a driver of a browser needing compatibility test by using a pre-written script; calling a Selenium library through a script to drive each browser and simulate a login request of a user, wherein the simulating of the login request of the user comprises the following steps: automatically opening an Html5 game page with each browser and simulating interaction of each element of an Html5 game page to generate a login request; executing each test case in a pre-constructed test case set under a pre-constructed test case environment, wherein each test case is positioned on each element in advance; and when all the test cases in the test case set are executed, automatically generating a test report. The compatibility test problem is effectively solved, the test efficiency is improved, and the time cost and the labor cost are saved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a flow chart of a method for automated testing of Html5 game page entries according to an embodiment of the present application;
FIG. 2 is a schematic diagram of the relationship between a test tool, a script and a browser according to an embodiment of the present application;
FIG. 3 is a block diagram of an automated testing device for Html5 game page entry according to an embodiment of the present application;
fig. 4 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments provided in the present application without any inventive step are within the scope of protection of the present application.
It is obvious that the drawings in the following description are only examples or embodiments of the present application, and that it is also possible for a person skilled in the art to apply the present application to other similar contexts on the basis of these drawings without inventive effort. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of ordinary skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments without conflict.
Unless defined otherwise, technical or scientific terms referred to herein shall have the ordinary meaning as understood by those of ordinary skill in the art to which this application belongs. Reference to "a," "an," "the," and similar words throughout this application are not to be construed as limiting in number, and may refer to the singular or the plural. The present application is directed to the use of the terms "including," "comprising," "having," and any variations thereof, which are intended to cover non-exclusive inclusions; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or elements, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. Reference to "connected," "coupled," and the like in this application is not intended to be limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The term "plurality" as referred to herein means two or more. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. Reference herein to the terms "first," "second," "third," and the like, are merely to distinguish similar objects and do not denote a particular ordering for the objects.
In order to solve the problem of compatibility testing, improve testing efficiency, and save time cost and labor cost, an embodiment of the application provides an automatic testing method for registering a Html5 game page, wherein an automatic testing process of the method is a part of testing work, is established relative to functional testing, and is mainly realized through Web, a software testing tool (namely, Selenium) and a script. Fig. 1 is a flowchart of an automated testing method for Html5 game page login according to an embodiment of the present application, as shown in fig. 1, the method includes:
s100: loading a driver of a browser needing compatibility test by using a pre-written script;
s200: calling a Selenium library through a script to drive each browser and simulate a login request of a user, wherein the login request of the simulated user comprises the following steps: automatically opening an Html5 game page with each browser and simulating interaction of each element of an Html5 game page to generate a login request;
s300: executing each test case in a pre-constructed test case set under a pre-constructed test case environment, wherein each test case is positioned on each element in advance;
s400: and when all the test cases in the test case set are executed, automatically generating a test report.
According to the content, not only is the drive of the browser needing to be subjected to the compatibility test automatically loaded through the script, but also the Selenium test can be directly operated in the browser, just like the operation of a real user, the browser supported by the Selenium test comprises IE (7, 8, 9, 10, 11), Mozilla Firefox, Safari, Google Chrome, Opera and the like, so that the Selenium library is automatically called through the script to simulate the interaction of the user on the Web, the compatibility and the automatic test of the Html5 game page login are realized, the compatibility test problem is effectively solved, the test efficiency is improved, the time cost and the labor cost are saved, and the consistency and the repeatability of the test are ensured. In addition, the expected results can be achieved by modifying the script, making the test easy to maintain.
Optionally, the test case environment may include a preset precondition and a preset postcondition, for example, before each test case is executed, a browser is opened, the browser is maximized, and/or a search button of the browser is clicked according to the precondition; and after each test case is executed, closing the browser according to the post condition.
Optionally, the test case may be created according to an equivalence class classification method or a boundary value analysis method, and then the created test case is located on the corresponding element.
The above equivalence class partitioning method divides all possible input data (valid and invalid) of a program into several equivalence classes. And then, selecting representative data from each part as a test case for reasonable classification, wherein the test case consists of representatives of effective equivalence classes and ineffective equivalence classes, thereby ensuring the integrity and the representativeness of the test case. The method can reduce the design of unnecessary test cases, because the test cases use the same equivalence class data, thereby leading the test object to obtain the same reflecting behavior.
The above boundary value analysis method is complementary to the equivalence class classification method, and in this case, the test case is derived from the boundary of the equivalence class.
In order to more clearly illustrate the automatic testing method for the login of the Html5 game page in the embodiment of the present application, specific examples are given below.
According to the embodiment of the application, an automatic testing framework is constructed, the testing cases can be led in by the automatic testing framework, and the machine can realize artificial and complicated clicking and inputting operations, so that the testing report can be automatically output to allow a testing engineer to check the testing result, wherein a plurality of testing cases can be written by an equivalence class division method and/or a boundary value analysis method.
As an embodiment, a driver (WebDriver) of a browser that needs to be subjected to a compatibility test is installed first, specifically, a script written in Java or Python language can be freely selected, and the driver of each browser is loaded using the written script.
The above-mentioned Selenium encapsulates various browser-driven requests (get, post, etc.) and contents (body), where the Selenium library is called by, for example, Python script to drive the browser, so as to completely simulate the user's operation on the browser, for example, simulate the user's login request: automatically opening the Html5 game page by using different browsers and simulating the interaction (such as clicking, inputting account numbers and passwords, dragging a mouse and the like) of each element of the Html5 game page, thereby generating various login requests.
The automated testing framework is one of the cores of the embodiment of the application and is beneficial to the automated testing of the login of the Html5 game page. Specifically, a test case is created using, for example, an equivalence class partition method and/or a boundary value analysis method, and from the viewpoint of code writing, a TestCase test class is created and inherits TestCase (). Then, the Web element positioning of the game login interface is used for positioning the corresponding elements, namely, each created test case is positioned on each element of the Html5 game page, so that the click and input (account and password) operations and the like of the player are simulated by using codes. For example, main () can construct a test case set, and by calling main (), the test cases in main () are run in sequence, and finally, a test report is automatically generated. Thus, basic login automation testing can be completed.
As a further improvement, the Setup () and TearDown () of the test framework can be used to simulate the pre-condition and the post-condition before and after the execution of each test case according to different login situations. Namely Setup () and TearDown () represent a precondition and a postcondition, respectively. For example, according to the Setup () precondition, buttons such as open a browser, maximize a browser, click a search of a browser, etc. may be used before executing each test case. Similarly, Teardown () means a post condition, for example: after each test case is executed, operations such as closing a browser can be simulated. Therefore, the steps are not required to be written on each test case, and only different input operations of a user need to be written, which is equivalent to building an environment for writing the test cases. And moreover, the code amount can be saved, and the storage cost can be saved.
Further, the test result of account registration can be judged by adding assertion, and whether the result of program execution and the set expected result are consistent or not is specifically judged. TestSuite () can also be used to represent the test case suite, and the test case classes that need to be executed are stored together. And executing the test case through the TestRunner, and then generating a test report, for example, generating a test report in an Html format. Related parameters can be filled in to improve the readability of the test report, and the test report can show which logging is successful and which logging is failed.
As an implementation manner, fig. 2 is a schematic diagram of a relationship between a test tool, a script and a browser according to an embodiment of the present application, as shown in fig. 2:
(1) the method comprises the steps that a driving address of a browser needing compatibility testing is placed under an directory of a Python script, and therefore the driving of each browser is loaded through the Python script;
(2) after the Webdriver is initialized, the browser can be controlled through codes to simulate automation operation, and firstly, the browser is opened;
(3) building a test case environment, namely setting the above-mentioned Setup () and Teardown (), the browser can complete the automatic precondition arrangement operation of Selenium, for example, opening the browser, maximizing the browser, clicking the search button of the browser, etc. before executing the test case;
(4) writing a test case: searching a game page through embedding and switching;
(5) writing a test case: and detecting the elements, and positioning and inputting the elements. Based on the steps (4) - (5), after the Web positioning element is successful, the browser simulates operations such as clicking and inputting of a user;
(6) defining a test case set comprising a plurality of test cases;
(7) and running the test suite and executing the TestCase in batches. Based on the steps (6) - (7), the browser executes all the TestCase operations;
(8) TestRunner is executed to generate a test report in Html format.
The embodiment of the present application further provides an automatic testing device for logging in an Html5 game page, which is used to implement the foregoing embodiment and preferred embodiments, and the description of the device is omitted. The term "module" as used below may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 3 is a block diagram of an automatic testing apparatus for Html5 game page login according to an embodiment of the present application, as shown in fig. 3, the apparatus includes: the system comprises a loading module 1, a calling module 2, an executing module 3 and a generating module 4. The loading module 1 is configured to load a driver of a browser requiring a compatibility test by using a pre-written script.
The calling module 2 is configured to call a Selenium library through a script to drive each browser and simulate a login request of a user, where the login request of the simulated user includes: automatically opening an Html5 game page with each browser and simulating interaction of each element of an Html5 game page to generate a login request;
the execution module 3 is used for executing each test case in the pre-constructed test case set under the pre-constructed test case environment, wherein each test case is positioned on each element in advance;
the generating module 4 is used for automatically generating a test report when all the test cases in the test case set are executed.
Optionally, the test case environment may include a preset precondition and a preset postcondition, for example, before each test case is executed, a browser is opened, the browser is maximized, and/or a search button of the browser is clicked according to the precondition; and after each test case is executed, closing the browser according to the post condition.
Optionally, the test case may be created according to an equivalence class classification method or a boundary value analysis method, and then the created test case is located on the corresponding element.
Optionally, the script is a Python script, and a driver address of a browser requiring a compatibility test may be placed in an entry of the Python script, so that a driver of each browser is loaded by using the Python script.
The above modules may be functional modules or program modules, and may be implemented by software or hardware. For a module implemented by hardware, the modules may be located in the same processor; or the modules can be respectively positioned in different processors in any combination.
Fig. 4 is a block diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 4, the electronic device may include a processor 81 and a memory 82 storing computer program instructions.
Specifically, the processor 81 may include a Central Processing Unit (CPU), or A Specific Integrated Circuit (ASIC), or may be configured to implement one or more Integrated circuits of the embodiments of the present Application.
Memory 82 may include, among other things, mass storage for data or instructions. By way of example, and not limitation, memory 82 may include a Hard Disk Drive (Hard Disk Drive, abbreviated to HDD), a floppy Disk Drive, a Solid State Drive (SSD), flash memory, an optical Disk, a magneto-optical Disk, tape, or a Universal Serial Bus (USB) Drive or a combination of two or more of these. Memory 82 may include removable or non-removable (or fixed) media, where appropriate. The memory 82 may be internal or external to the data processing apparatus, where appropriate. In a particular embodiment, the memory 82 is a Non-Volatile (Non-Volatile) memory. In particular embodiments, Memory 82 includes Read-Only Memory (ROM) and Random Access Memory (RAM). The ROM may be mask-programmed ROM, Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), Electrically rewritable ROM (earrom), or FLASH Memory (FLASH), or a combination of two or more of these, where appropriate. The RAM may be a Static Random-Access Memory (SRAM) or a Dynamic Random-Access Memory (DRAM), where the DRAM may be a Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), an Extended data output Dynamic Random-Access Memory (EDODRAM), a Synchronous Dynamic Random-Access Memory (SDRAM), and the like.
The memory 82 may be used to store or cache various data files for processing and/or communication use, as well as possible computer program instructions executed by the processor 81.
The processor 81 implements any of the above described embodiments of an automated testing method for Html5 game page entries by reading and executing computer program instructions stored in the memory 82.
In some of these embodiments, the electronic device may also include a communication interface 83 and a bus 80. As shown in fig. 4, the processor 81, the memory 82, and the communication interface 83 are connected via the bus 80 to complete communication therebetween.
The communication interface 83 is used for implementing communication between modules, devices, units and/or equipment in the embodiment of the present application. The communication port 83 may also be implemented with other components such as: the data communication is carried out among external equipment, image/data acquisition equipment, a database, external storage, an image/data processing workstation and the like.
The bus 80 includes hardware, software, or both to couple the components of the electronic device to one another. Bus 80 includes, but is not limited to, at least one of the following: data Bus (Data Bus), Address Bus (Address Bus), Control Bus (Control Bus), Expansion Bus (Expansion Bus), and Local Bus (Local Bus). By way of example, and not limitation, Bus 80 may include an Accelerated Graphics Port (AGP) or other Graphics Bus, an Enhanced Industry Standard Architecture (EISA) Bus, a Front-Side Bus (FSB), a Hyper Transport (HT) Interconnect, an ISA (ISA) Bus, an InfiniBand (InfiniBand) Interconnect, a Low Pin Count (LPC) Bus, a memory Bus, a microchannel Architecture (MCA) Bus, a PCI (Peripheral Component Interconnect) Bus, a PCI-Express (PCI-X) Bus, a Serial Advanced Technology Attachment (SATA) Bus, a Video Electronics Bus (audio Electronics Association), abbreviated VLB) bus or other suitable bus or a combination of two or more of these. Bus 80 may include one or more buses, where appropriate. Although specific buses are described and shown in the embodiments of the application, any suitable buses or interconnects are contemplated by the application.
In addition, in combination with the automatic testing method for the login of the Html5 game page in the above embodiment, the embodiment of the present application may be implemented by providing a computer-readable storage medium. The computer readable storage medium having stored thereon computer program instructions; the computer program instructions, when executed by the processor, implement any one of the above embodiments of an automated testing method for Html5 game page entry.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. An automatic testing method for login of an Html5 game page, which is characterized by comprising the following steps:
loading a driver of a browser needing compatibility test by using a pre-written script;
calling a Selenium library through the script to drive each browser and simulate a login request of a user, wherein the login request of the simulated user comprises: automatically opening an Html5 game page with each said browser and simulating interaction of elements of said Html5 game page to generate a login request;
executing each test case in a pre-constructed test case set under a pre-constructed test case environment, wherein each test case is positioned to each element in advance;
and when all the test cases in the test case set are completely executed, automatically generating a test report.
2. The method according to claim 1, wherein, in a case that the test case environment includes a pre-condition and a post-condition, the executing each test case in the pre-constructed test case set in the pre-constructed test case environment comprises:
before executing each test case, opening a browser, maximizing the browser and/or clicking a search button of the browser according to the precondition;
and after each test case is executed, closing the browser according to the post condition.
3. The method of claim 1, wherein said locating each of said test cases onto each of said elements comprises:
creating a test case according to an equivalence class division method or a boundary value analysis method;
and positioning the created test case to the corresponding element.
4. The method according to claim 1, wherein, in the case that the script is a Python script, loading a driver of a browser requiring a compatibility test by using a pre-written script comprises:
placing a driving address of a browser needing compatibility testing under a directory of the Python script;
and loading the driver of each browser by using the Python script.
5. An apparatus for automated testing of Html5 game page entries, comprising:
the loading module is used for loading the driver of the browser needing to be subjected to the compatibility test by utilizing a pre-written script;
a calling module, configured to call a Selenium library through the script to drive each browser and simulate a login request of a user, where the login request of the simulated user includes: automatically opening an Html5 game page with each said browser and simulating interaction of elements of said Html5 game page to generate a login request;
the execution module is used for executing each test case in a pre-constructed test case set under a pre-constructed test case environment, wherein each test case is positioned to each element in advance;
and the generating module is used for automatically generating a test report when all the test cases in the test case set are executed.
6. The apparatus according to claim 5, wherein, in a case that the test case environment includes a pre-condition and a post-condition, the executing each test case in the pre-constructed test case set in the pre-constructed test case environment includes:
before executing each test case, opening a browser, maximizing the browser and/or clicking a search button of the browser according to the precondition;
and after each test case is executed, closing the browser according to the post condition.
7. The apparatus of claim 5, wherein said locating each of said test cases onto each of said elements comprises:
creating a test case according to an equivalence class division method or a boundary value analysis method;
and positioning the created test case to the corresponding element.
8. The apparatus according to claim 5, wherein, in the case that the script is a Python script, the loading the driver of the browser requiring the compatibility test by using the pre-written script comprises:
placing a driving address of a browser needing compatibility testing under a directory of the Python script;
and loading the driver of each browser by using the Python script.
9. An electronic device comprising a processor and a storage medium storing a computer program, wherein the computer program, when executed by the processor, implements an automated testing method for Html5 game page login as claimed in any one of claims 1 to 4.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method for automated testing of the login of an Html5 game page according to any one of claims 1 to 4.
CN202011484061.1A 2020-12-15 2020-12-15 Automatic testing method, device, equipment and medium for login of Html5 game page Pending CN112506785A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011484061.1A CN112506785A (en) 2020-12-15 2020-12-15 Automatic testing method, device, equipment and medium for login of Html5 game page

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011484061.1A CN112506785A (en) 2020-12-15 2020-12-15 Automatic testing method, device, equipment and medium for login of Html5 game page

Publications (1)

Publication Number Publication Date
CN112506785A true CN112506785A (en) 2021-03-16

Family

ID=74972419

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011484061.1A Pending CN112506785A (en) 2020-12-15 2020-12-15 Automatic testing method, device, equipment and medium for login of Html5 game page

Country Status (1)

Country Link
CN (1) CN112506785A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113157596A (en) * 2021-05-26 2021-07-23 中国银行股份有限公司 Automatic testing method and device
CN113836042A (en) * 2021-11-18 2021-12-24 四川启睿克科技有限公司 Web automated testing framework system
CN115514677A (en) * 2022-09-20 2022-12-23 建信金融科技有限责任公司 Server dial testing method and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102033803A (en) * 2009-09-29 2011-04-27 国际商业机器公司 Method and device for testing web application across browsers
CN103186465A (en) * 2011-12-31 2013-07-03 北京新媒传信科技有限公司 Browser compatibility testing method and system for webpage user interface
CN104424315A (en) * 2013-09-06 2015-03-18 活点信息技术有限公司 Data processing method for IOT (Internet of things) browser system and IOT browser system
CN106411633A (en) * 2016-08-23 2017-02-15 国家电网公司 Web application compatibility testing method based on openstack and system thereof
CN108829583A (en) * 2018-05-24 2018-11-16 广东睿江云计算股份有限公司 A kind of page compatibility test method and device based on Selenium
CN109669851A (en) * 2018-12-25 2019-04-23 上海新炬网络技术有限公司 Performance test script method for recording based on Selenium automation
CN111737114A (en) * 2020-06-05 2020-10-02 苏州浪潮智能科技有限公司 Login function testing method and device
WO2020233331A1 (en) * 2019-05-20 2020-11-26 深圳壹账通智能科技有限公司 User interface automated testing method and apparatus, and computer-readable storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102033803A (en) * 2009-09-29 2011-04-27 国际商业机器公司 Method and device for testing web application across browsers
CN103186465A (en) * 2011-12-31 2013-07-03 北京新媒传信科技有限公司 Browser compatibility testing method and system for webpage user interface
CN104424315A (en) * 2013-09-06 2015-03-18 活点信息技术有限公司 Data processing method for IOT (Internet of things) browser system and IOT browser system
CN106411633A (en) * 2016-08-23 2017-02-15 国家电网公司 Web application compatibility testing method based on openstack and system thereof
CN108829583A (en) * 2018-05-24 2018-11-16 广东睿江云计算股份有限公司 A kind of page compatibility test method and device based on Selenium
CN109669851A (en) * 2018-12-25 2019-04-23 上海新炬网络技术有限公司 Performance test script method for recording based on Selenium automation
WO2020233331A1 (en) * 2019-05-20 2020-11-26 深圳壹账通智能科技有限公司 User interface automated testing method and apparatus, and computer-readable storage medium
CN111737114A (en) * 2020-06-05 2020-10-02 苏州浪潮智能科技有限公司 Login function testing method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王欢欢等: "Web应用界面跨浏览器兼容性的自动检测方法", 计算机科学, no. 2, 15 November 2015 (2015-11-15) *
高培: "基于Web应用的浏览器兼容性测试方法研究", 软件导刊, no. 09, 15 September 2020 (2020-09-15) *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113157596A (en) * 2021-05-26 2021-07-23 中国银行股份有限公司 Automatic testing method and device
CN113836042A (en) * 2021-11-18 2021-12-24 四川启睿克科技有限公司 Web automated testing framework system
CN115514677A (en) * 2022-09-20 2022-12-23 建信金融科技有限责任公司 Server dial testing method and system
CN115514677B (en) * 2022-09-20 2023-06-20 建信金融科技有限责任公司 Method and system for server dial testing

Similar Documents

Publication Publication Date Title
CN112506785A (en) Automatic testing method, device, equipment and medium for login of Html5 game page
CN110008113B (en) Test method and device and electronic equipment
US9135147B2 (en) Automated testing of applications with scripting code
CN109189479B (en) Parallel automatic verification method for processor instruction set
CN112560372B (en) Chip prototype verification method, device, equipment and medium
Sun et al. {KSG}: Augmenting kernel fuzzing with system call specification generation
CN110704113B (en) Starting method and system based on FPGA platform and development board device
US7243059B2 (en) Simulation of hardware based on smart buffer objects
CN109491904B (en) Automatic testing method and device for spark SQL application program
CN117370203A (en) Automatic test method, system, electronic equipment and storage medium
CN116841543A (en) Development method for dynamically generating cross-platform multi-terminal application based on Flutter
CN112015436A (en) Short message platform deployment method and device, computing equipment and computer storage medium
CN113641594B (en) Cross-terminal automatic testing method and related device
CN115562931A (en) Processor debugging module verification method and device, electronic equipment and storage medium
CN108334313A (en) Continuous integrating method, apparatus and code management system for large-scale SOC research and development
CN114297088A (en) Method, device, equipment and medium for testing front end vue frame assembly
CN114281709A (en) Unit testing method, system, electronic equipment and storage medium
CN113238953A (en) UI automation test method and device, electronic equipment and storage medium
CN109408063B (en) Instruction pile inserting method and device based on virtual machine
US20050034120A1 (en) Systems and methods for cooperatively building public file packages
Mota et al. Spring Framework for Testing
CN113608996B (en) Mirror image compiling test method, system, device and readable storage medium
CN112580282B (en) Method, apparatus, device and storage medium for integrated circuit design verification
JP2002014847A (en) Device for checking program and method for the same and recording medium with checking program stored
Kaur et al. SFrame: Design & Development of Smart Framework to Port Linux Kernel on ARM based Raspberry Pi

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