CN115292646A - Page information replacement method and device and configuration file generation method and device - Google Patents

Page information replacement method and device and configuration file generation method and device Download PDF

Info

Publication number
CN115292646A
CN115292646A CN202210995097.9A CN202210995097A CN115292646A CN 115292646 A CN115292646 A CN 115292646A CN 202210995097 A CN202210995097 A CN 202210995097A CN 115292646 A CN115292646 A CN 115292646A
Authority
CN
China
Prior art keywords
page
replaced
tested
attribute
file
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
CN202210995097.9A
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.)
Ping An E Wallet Electronic Commerce Co Ltd
Original Assignee
Ping An E Wallet Electronic Commerce 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 Ping An E Wallet Electronic Commerce Co Ltd filed Critical Ping An E Wallet Electronic Commerce Co Ltd
Priority to CN202210995097.9A priority Critical patent/CN115292646A/en
Publication of CN115292646A publication Critical patent/CN115292646A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • 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
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a page information replacement method and device and a configuration file generation method and device, wherein the page information replacement method comprises the following steps: when a page to be tested is loaded, acquiring attribute information of page elements of the page to be tested in a target environment; the attribute information is determined based on a voice instruction input by a tester and a first file which is stored in advance and contains the attribute information of the page element of the tested page; replacing attribute information to be replaced of the page elements of the page to be tested in the historical environment according to the attribute information of the page elements of the page to be tested in the target environment; and after the attribute information to be replaced of the page element is replaced, loading the tested page, rendering and displaying. Based on the method, the test can be efficiently completed, the tester can independently complete the replacement of the page elements under different environments without the help of developers, and the page functions under different environments can be tested.

Description

Page information replacement method and device and configuration file generation method and device
Technical Field
The invention relates to the field of testing, in particular to a method and a device for replacing page information and a method and a device for generating a configuration file.
Background
Generally, when a tester verifies page functions in different testing environments, a front-end developer needs to modify a code file corresponding to a page to be tested again, for attributes corresponding to each button element of the page corresponding to the environment to be tested, for example, links where each button element jumps, need to be replaced one by one, and after replacement, the page functions are packaged to the tester, and the tester verifies the page functions. The method has low efficiency and is not beneficial to the test of testers, so how to efficiently finish the test, the testers do not need the help of developers, the replacement of page elements under different environments can be independently finished, and the problem of urgently solving the problem of testing the page functions under different environments is solved at present.
Disclosure of Invention
The invention provides a page information replacement method and device and a configuration file generation method and device, which are used for solving the defects that the test efficiency is low and the test is not facilitated for testers in the prior art, realizing the high-efficiency completion of the test, enabling the testers to independently complete the replacement of page elements in different environments without the help of developers, and testing the page functions in the different environments.
A method of page information replacement, the method comprising: when a page to be tested is loaded, acquiring attribute information of page elements of the page to be tested in a target environment; the attribute information to be replaced is determined based on a voice instruction input by a tester and a first file which is stored in advance and contains attribute information of a page element of a tested page; replacing attribute information to be replaced of the page elements of the page to be tested in the historical environment according to the attribute information of the page elements of the page to be tested in the target environment; and after the attribute information to be replaced of the page element is replaced, loading the page to be tested, rendering and displaying.
In one embodiment, the determining process of the attribute information of the page element of the page to be tested in the target environment includes: displaying a tested page and the first file on a configuration page; acquiring attribute information of a page element of a tested page in the first file from a second file corresponding to a code of the tested page; and responding to a voice operation instruction of a user to the first file, and determining a page element to be replaced, a property to be replaced of the page element to be replaced and an attribute value of the page element to be replaced in a target environment.
In one embodiment, in response to a voice operation instruction of a user on the first file, determining a page element to be replaced, a property to be replaced of the page element to be replaced, and an attribute value of the page element to be replaced in a target environment; the method comprises the following steps: responding to a first voice control instruction of a tester to the first file, determining page elements to be replaced in the page elements in the tested page, and displaying the attributes of the page elements to be replaced and the attribute values of the page elements in the historical environment; and responding to a second voice control instruction of the tester to the first file, and determining the attribute to be replaced of the page element to be replaced and the attribute value of the page element to be replaced in the target environment.
A method of generating a configuration file, the method comprising: displaying a tested page and a first file which is stored in advance and contains attribute information of a page element of the tested page on a configuration page; acquiring attribute information of a page element of a tested page in the first file from a second file corresponding to a code of the tested page; responding to a voice operation instruction of a user to the first file, and determining a page element to be replaced in the page elements in the detected page, a property to be replaced of the page element to be replaced and a property value of the page element to be replaced in a target environment; replacing the attribute to be replaced of the page element to be replaced and the attribute value of the page element to be replaced in the historical environment on the basis of the attribute to be replaced and the attribute value of the page element to be replaced in the target environment; and generating a page configuration file of the tested page in the target environment based on the attribute value to be replaced of the replaced page element.
In one embodiment, the determining, in response to a voice operation instruction of a user on the first file, a page element to be replaced, a property to be replaced of the page element to be replaced, and a property value thereof in a target environment in page elements in the detected page includes: responding to a first voice control instruction of a tester to the first file, determining page elements to be replaced in the page elements in the tested page, and displaying the attributes of the page elements to be replaced and the attribute values of the page elements in the historical environment; and responding to a second voice control instruction of the tester to the first file, and determining the attribute to be replaced of the page element to be replaced and the attribute value in the target environment.
In one embodiment, the generating a page configuration file of the tested page in the target environment based on the attribute value to be replaced of the replaced page element includes: and responding to a third voice operation instruction of the user, and storing the attribute and the attribute value of the replaced page element in a json data form.
A page information replacing apparatus, the apparatus comprising:
the acquisition module is used for acquiring attribute information of page elements of the page to be tested in the target environment when the page to be tested is loaded; the attribute information to be replaced is determined based on a voice instruction input by a tester and a first file which is stored in advance and contains attribute information of a page element of a tested page; the first replacement module is used for replacing attribute information to be replaced of the page elements of the page to be tested in the historical environment according to the attribute information of the page elements of the page to be tested in the target environment; and the processing module is used for loading the page to be tested and rendering and displaying the page after the attribute information to be replaced of the page element is replaced.
An apparatus for generating a configuration file, the apparatus comprising: the display module is used for displaying the tested page and a first file which is stored in advance and contains the attribute information of the page element of the tested page on the configuration page; acquiring attribute information of a page element of a tested page in the first file from a second file corresponding to a code of the tested page;
the determining module is used for responding to a voice operation instruction of a user to the first file, and determining a page element to be replaced in the page elements in the detected page, the attribute to be replaced of the page element to be replaced and the attribute value of the page element to be replaced in a target environment; the second replacement module is used for replacing the attribute to be replaced of the page element to be replaced and the attribute value of the page element to be replaced in the historical environment on the basis of the attribute to be replaced and the attribute value of the page element to be replaced in the target environment; and the generating module is used for generating a page configuration file of the detected page in the target environment based on the attribute value to be replaced of the replaced page element.
A computer device comprising a memory and a processor, the memory having stored therein computer-readable instructions which, when executed by the processor, cause the processor to perform the steps of the above-described method of generating a page information replacement or configuration file.
A storage medium storing computer readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the above method of page information replacement or generation of the configuration file.
According to the page information replacement method and device, in the loading process of the tested page, the attribute information of the page element of the tested page in the target environment is adopted to replace the attribute information to be replaced of the page element of the tested page in the historical environment, so that after the tested page is rendered and displayed, the attribute information of the corresponding page element is the attribute information in the target environment, and the attribute information of the page element can be directly determined through the voice instruction and the first file which is stored in advance and contains the attribute information of the page element of the tested page, so that a tester does not need to know how to modify the code of the tested page, and can also directly determine the attribute value of the page element according to the first file and complete the replacement of the attribute value, thereby facilitating the tester to test, enabling the tester to independently complete the replacement of the page element in different environments without the help of a developer, and accelerating the test progress to a certain extent. In addition, the attribute information of the page elements of the tested page in the target environment is determined based on the voice instruction input by the tester, can be directly acquired, is simple and easy to operate for the tester, and enables the testing process to be more efficient.
According to the method and the device for generating the configuration file, the configuration page is provided, the tested page and the first file which is stored in advance and contains the attribute information of the page element of the tested page are displayed, so that a tester can configure the attribute value of the corresponding page element under the target environment conveniently, and can determine the attribute to be replaced and the attribute value under the target environment based on the voice operation instruction of the tester, and therefore, a simple method is provided, the tester can independently complete the replacement of the attribute value of the attribute to be replaced of the page element, and the corresponding configuration file is obtained, so that an application program or a webpage can automatically replace the attribute value of the corresponding page element according to the configuration file during testing in the target environment, the attribute value of the page element does not need to be manually modified one by one, the test can be efficiently completed, the tester does not need the help of a developer, can independently complete the replacement of the page elements under different environments, and can test the functions of the page under different environments.
Drawings
Fig. 1 is a schematic diagram of a test scenario performed by a tester in the prior art.
Fig. 2 is a schematic diagram of an implementation environment of a page information replacement method or a configuration file generation method provided in an embodiment;
FIG. 3 is a flowchart illustrating a page information replacement method according to one embodiment;
FIG. 4 is a second flowchart illustrating a page information replacement method according to an embodiment;
FIG. 5 is a flowchart illustrating a method for generating a configuration file according to an embodiment;
FIG. 6 is a diagram illustrating the contents of a first file in one embodiment;
FIG. 7 is a block diagram showing the structure of a page information replacing apparatus according to an embodiment;
FIG. 8 is a block diagram showing an example of a configuration file generation apparatus according to an embodiment;
fig. 9 is a schematic physical structure diagram of an electronic device.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It is to be noted that technical terms or scientific terms used herein should have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs, unless otherwise defined. The use of "first," "second," and similar terms in the present application do not denote any order, quantity, or importance, but rather the terms are used to distinguish one element from another. The word "comprising" or "comprises", and the like, means that the element or item listed before the word covers the element or item listed after the word and its equivalents, but does not exclude other elements or items. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", and the like are used only to indicate relative positional relationships, and when the absolute position of the object being described is changed, the relative positional relationships may also be changed accordingly.
For ease of understanding, the problems in the prior art when testing by a tester will be described first with reference to fig. 1. As shown in fig. 1, when an application (App) opens a page of an H5 resource package, specifically, an order detail page, has an "order number: sx1232334"," origin: city a "," receiving place: b city ", and the page's buttons" view details "and" view details "these page elements. Where a button of a page, when clicked, requests some interface. However, when the tester performs a functional test on the page in the environment a, clicking "view details" requires requesting the URL1 interface, and clicking "view tracks" requires requesting the URL2 interface. However, when switching to the B environment, the URL1 is not accessed when clicking the "view details" again, because the URL3 address should be actually requested in the B environment, and the "view track" needs to request the URL4 interface in the B environment, but because the tester may need the assistance of the developer, the tester may perform the test in the B environment after modifying the jump link corresponding to the "view details" and the "view track" in the implementation code of the page, and the operation in switching the environment is passive and limited by the constraint of the development resource, so sometimes only the related verification can be performed in the a environment, and various environment verification functions cannot be effectively and sufficiently simulated in the B environment. The efficiency of the whole test is low, the test is troublesome, and the test is not easy to be smoothly carried out, so that the page information replacement method and the device, and the configuration file generation method and the device can be used for efficiently completing the test, enabling the tester to independently complete the replacement of the page elements in different environments without the help of developers, and testing the page functions in different environments.
The following describes a method and an apparatus for replacing page information, and a method and an apparatus for generating a configuration file according to the present invention with reference to fig. 2 to 9.
Fig. 2 is a diagram of an implementation environment of a page information replacing method and a configuration file generating method provided in an embodiment, as shown in fig. 2, in the implementation environment, including a computer device 210, a terminal 220, and a server 230.
The computer device 210 is a testing device, for example, a computer device such as a computer used by a tester, and the computer device 210 is installed with an application program to be tested, or may be connected to a page of a web page to be tested. The configuration page can be opened on the terminal 220, so that the tester configures the attribute information of the page elements of the tested page and sends the configured attribute information to the server 230 for storage, when the target environment is required to be tested, the computer device 210 can obtain the attribute information of the page elements in the page to be tested under the configured target environment from the server 230 and automatically complete the replacement of the attribute information, so that the tester can directly test the page functions to be tested under the target environment on the computer device 210, thereby efficiently completing the test, the tester does not need the help of developers, can independently complete the replacement of the page elements under different environments, and test the page functions under different environments.
It should be noted that the terminal 220 and the computer device 210 may be, but are not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, and the like.
As shown in fig. 3, in an embodiment, a page information replacing method is provided, which can be applied to the computer device 210, and specifically includes the following steps:
and 310, when the page to be tested is loaded, acquiring attribute information of the page element of the page to be tested in the target environment.
The attribute information is determined based on the voice command input by the tester and a first file which is stored in advance and contains the attribute information of the page element of the tested page. The attribute information is an attribute to be replaced and a corresponding attribute value of a page element of the page to be tested, and may be, for example, a page button and a corresponding jump link thereof, a document displayed by the button, or a style displayed by the button. The attribute information of the page element of the tested page in the first file can be acquired from the second file corresponding to the code of the tested page. Specifically, all attribute information of all page elements of the tested page can be acquired from a second file corresponding to the code of the tested page in a key value pair mode and stored in a first file, so that the attribute information of the page elements of the tested page under the target environment can be determined based on the first file, a tester does not need to know how to modify the code of the tested page, the attribute values of the page elements can be directly determined according to the first file, and the replacement of the attribute values can be completed, so that the test can be performed by the tester conveniently, the tester does not need the help of developers, the replacement of the page elements under different environments can be completed independently, and the test progress can be accelerated to a certain extent.
It can be understood that, when the page to be tested is loaded, the attribute value of the corresponding page element on the page to be tested may be a value in the historical environment, and therefore, in the target environment, the attribute value of the corresponding page element on the page to be tested needs to be updated to complete the corresponding function test. Therefore, attribute information of the page element of the page to be tested in the target environment needs to be acquired.
Specifically, the page information of the detected page in the corresponding target environment may be obtained from the server 230; and then determining attribute information of the page elements of the page to be tested in the target environment according to the page information of the page to be tested in the target environment. The page information of the detected page comprises information of all page elements on the page, so that the attribute information of the page elements of the detected page in the target environment can be determined according to the page information of the detected page in the target environment.
It can be understood that the page information of the tested page may be stored in the form of json data, so that the application program or the web page may be enabled to automatically acquire the json data corresponding to the tested page by adding a plug-in to acquire the page information of the tested page, and determine the attribute information of the page element of the tested page in the target environment in the form of a key-value pair. For example, the attribute information of the page element may include an identification of each page element, path information of each page element, and a name and function description information of each page element. For example, for the page element "view details button", the corresponding attribute information may include: identify "ID = view detail button element ID", path information "href = https:// www.xxxxxx.com", and page element name and function description information "td = view order detail".
It can also be understood that, with reference to the description of the application environment in fig. 2, the attribute information of the page element of the page to be tested in the target environment may be obtained by opening a configuration page on the terminal 220 for the tester, configuring the attribute information of the page element of the page to be tested, and sending the configured attribute information to the server 230 for storage, so that when the configurator configures the attribute information of the page element of the page to be tested, the terminal 220 may determine the attribute information of the page element of the page to be tested in the target environment by inputting a voice instruction. By the method, the tester can conveniently and independently complete the replacement of the attribute information to be replaced of the page elements of the tested page in different environments, and the subsequent test of the page functions of the tested page in the target environment is facilitated.
And step 320, replacing attribute information to be replaced of the page elements of the page to be tested in the historical environment according to the attribute information of the page elements of the page to be tested in the target environment.
It can be understood that, after obtaining the attribute information of the page element of the page to be tested in the target environment, the attribute information of the attribute to be replaced of the page element of the page to be tested in the history environment can be replaced by the attribute information, for example, the path information of the corresponding attribute of the page element of the "view detail button" in the history environment is "href =https://www.xxxxCom ", the path information in the corresponding attribute under the target environment is" href = https:// www.yyyyyyyy.com ", and the path information in the attribute after replacement is" href = https:// www.yyyyy.com ".
And step 330, after the attribute information to be replaced of the page element is replaced, loading the page to be tested, and rendering and displaying the page.
It can be understood that, the steps 310 and 320 and the replacement process of the attribute information to be replaced of the page element are all completed in the process of loading the page to be tested, and the page is displayed only after the page to be tested is loaded and rendered, so that, after the step 330 is completed, that is, after the attribute information to be replaced of the page element of the page to be tested is replaced by the attribute information corresponding to the target environment, the displayed page to be tested can be directly used for testing in the target environment. By the method, the tester can conveniently and independently complete the replacement of the attribute information to be replaced of the page elements of the tested page in different environments, and the page function of the tested page in the target environment can be conveniently and subsequently tested.
The page information replacement method provided by the invention has the advantages that in the process of loading a tested page, the attribute information of the page element of the tested page in the target environment is adopted to replace the attribute information to be replaced of the page element of the tested page in the historical environment, so that after the tested page is rendered and displayed, the attribute information of the corresponding page element is the attribute information in the target environment, and the attribute information of the page element can be directly determined through a voice instruction and a first file which is stored in advance and contains the attribute information of the page element of the tested page, so that a tester does not need to know how to modify the code of the tested page, and can also directly determine the attribute value of the page element according to the first file and complete the replacement of the attribute value, thereby facilitating the tester to test, ensuring that the tester does not need the help of developers, and can independently complete the replacement of the page element in different environments, thereby accelerating the test progress to a certain extent. In addition, the attribute information of the page elements of the tested page in the target environment is determined based on the voice instruction input by the tester, can be directly acquired, is simple and easy to operate for the tester, and enables the testing process to be more efficient.
As shown in fig. 4, in one embodiment, the determining process of the attribute information of the page element of the page under test in the target environment may be executed by the terminal 220, and may include the following steps:
step 410, displaying the tested page and the first file on the configuration page.
The configuration page is used for configuring attribute information of page elements of the tested page by a tester. Wherein the content of the first file may be as shown in fig. 6 below.
It can be understood that, since the attribute information of the page element of the tested page is directly shown in the first file, the tester can directly determine the attribute information of the corresponding page element without reading the code of the tested page, thereby determining the attribute value of the attribute to be modified, and the tester can independently complete the replacement of the page element in different environments without the help of a developer, thereby accelerating the test progress to a certain extent.
Step 420, in response to the voice operation instruction of the user on the first file, determining a page element to be replaced in the page elements in the detected page, a property to be replaced of the page element to be replaced, and a property value of the page element to be replaced in the target environment.
The step may specifically include step 4201 and step 4202, and step 4201 and step 4202 are described in detail below.
Step 4201, in response to a first voice control instruction of a tester to the first file, determining a page element to be replaced in page elements in a tested page, and displaying an attribute of the page element to be replaced in the page elements and an attribute value of the page element in a historical environment.
The first voice control instruction of the tester may be a control instruction for the first file. It will be appreciated that the first file includes attribute information for the page elements. Therefore, the tester may enable the terminal 220 to determine the page element to be replaced in the page elements in the tested page through the voice control instruction, and display the attribute of the page element to be replaced in the page element and the attribute value thereof in the historical environment.
Specifically, the first file corresponding to the tested page and the page elements in the tested page may be labeled, so that the tester can input the voice instruction according to the label. For example, if the label of the first file corresponding to the tested page is 1, the tester may input a voice control instruction "open file No. 1" or "expand file No. 1" at the terminal 220, the terminal 220 may display the attribute information of the page element No. 1, and the tester may view the attribute information corresponding to the page element with the label 1. The attribute information corresponding to the page element includes an attribute and an attribute value of the page element.
Step 4202, in response to the second voice control instruction of the tester to the first file, determining the attribute to be replaced of the page element to be replaced and the attribute value of the page element to be replaced in the target environment.
As shown in step 4201, after the terminal 220 displays the attributes of the page element to be replaced and the attribute values thereof in the historical environment, the tester may see the attributes of the page element to be replaced and the attribute values thereof in the historical environment, and since there is more than one attribute of the page element to be replaced, the corresponding attribute to be replaced is uncertain, the tester may input a second voice control instruction at the terminal 220 to determine the attribute to be replaced and the attribute value thereof in the target environment. Similarly, the attributes of the page elements in the tested page can be labeled, so that the tester can input the voice instruction according to the labels. Illustratively, the attribute to be replaced of the page element to be replaced is "1", the tester may input a second voice instruction "update the attribute value No. 1 of the page element No. 1 to href = https:// www.yyyyyyy.com", so that the attribute value of the attribute to be replaced of the page element to be replaced in the target environment may be determined. The voice instruction may also be directly input according to the identification information of the attribute, for example, "update the herf attribute of element number 1 to https:// www.yyyyyy.com", which is not limited in this disclosure. It should be noted that the user may also determine the attribute value of the attribute to be replaced of the page element to be replaced in the target environment by means of mouse input or handwriting input.
Based on the method, the tester can determine the attribute information to be replaced of the page element to be replaced by the voice instruction, so that the foundation is laid for realizing simple and convenient replacement of the page information, and the testing process is more efficient and convenient.
As shown in fig. 5, in one embodiment, a method for generating a configuration file is provided, where the method for generating a configuration file may be applied to the terminal 220, and specifically includes the following steps:
step 510, displaying the tested page and a first file which is stored in advance and contains the attribute information of the page element of the tested page on the configuration page.
And acquiring attribute information of the page element of the page to be detected in the first file from a second file corresponding to the code of the page to be detected.
Step 520, responding to the voice operation instruction of the user to the first file, determining the page element to be replaced in the page elements in the detected page, the attribute to be replaced of the page element to be replaced and the attribute value of the page element to be replaced in the target environment.
Specifically, the method can respond to a first voice control instruction of a tester to the first file, determine a page element to be replaced in page elements in a tested page, and display the attribute of the page element to be replaced in the page elements and the attribute value of the page element in the historical environment; and responding to a second voice control instruction of the tester to the first file, and determining the attribute to be replaced of the page element to be replaced and the attribute value under the target environment.
It is understood that the detailed description of step 510 and step 520 may refer to the related description of fig. 4, and for brevity, will not be described herein again.
And step 530, replacing the attribute to be replaced of the page element to be replaced and the attribute value thereof in the historical environment based on the attribute to be replaced and the attribute value thereof in the target environment.
Specifically, the attribute to be replaced of the page element to be replaced and the attribute value thereof in the history environment may be replaced by a key-value pair index, for example, indexing to the corresponding value of "yes" in the target environment according to the key "href" of the attribute to be replaced "https://www.yyyyyy.com", the corresponding value in the historical context is" https:// www.xxxxxx.com ", the value of the key" href "is replaced from" https:// www.xxxxxx.com ".https://www.yyyyyy.com”。
And 540, generating a page configuration file of the detected page in the target environment based on the attribute value to be replaced of the replaced page element.
In some embodiments, generating a page configuration file of a detected page in a target environment based on an attribute value to be replaced of a replaced page element includes: and responding to a third voice operation instruction of the user, and saving the attribute and the attribute value of the replaced page element in the form of json data.
The third voice operation instruction may be, for example, "export file No. 1 as a json file".
According to the method for generating the configuration file, the configuration page is provided, the tested page and the first file which is stored in advance and contains the attribute information of the page element of the tested page are displayed, so that a tester can configure the attribute value of the corresponding page element under the target environment conveniently, and can determine the attribute to be replaced and the attribute value of the attribute to be replaced under the target environment based on the voice operation instruction of the tester, and therefore, a simple method is provided, the tester can independently complete the replacement of the attribute value of the attribute to be replaced of the page element, the corresponding configuration file is obtained, so that an application program or a webpage can automatically replace the attribute value of the corresponding page element according to the configuration file during testing under the target environment, the attribute value of the page element does not need to be manually modified one by one, the test can be efficiently completed, the tester does not need the help of a developer, can independently complete the replacement of the page elements under different environments, and can test the page functions under different environments.
Fig. 6 is a schematic content diagram of a first file provided by the present invention. As shown in fig. 6, the corresponding first file includes all attribute information of all page elements of the tested page. Wherein the page elements include: a view details button and a view track button. The attribute corresponding to the detail viewing button comprises ID, herf and td, and the values corresponding to the attribute ID, herf and td of the detail viewing button are element ID of the detail viewing button, https:// www.xxxxx.com and order detail viewing. Similarly, the attributes corresponding to the view track button comprise ID, herf and td, and the values corresponding to the attributes ID, herf and td of the view track button are the element ID of the view track button, https:// www.xxxxx.com and the view track.
The following describes a page information replacing apparatus and a configuration file generating apparatus according to the present invention, where the page information replacing apparatus described below and the above-described page information replacing method are referred to in correspondence, and the configuration file generating apparatus may be referred to in correspondence with the above-described configuration file generating method.
Fig. 7 is a schematic block diagram of a page information replacing apparatus provided in the present invention. As shown in fig. 7, the page information replacing apparatus provided by the present invention includes:
an obtaining module 710, configured to obtain attribute information of a page element of a page to be tested in a target environment when the page to be tested is loaded; the attribute information to be replaced is determined based on a voice instruction input by a tester and a first file which is stored in advance and contains attribute information of a page element of a tested page;
a first replacing module 720, configured to replace, according to the attribute information of the page element of the detected page in the target environment, attribute information to be replaced of the page element of the detected page in the historical environment;
and the processing module 730 is configured to load the page to be tested, render and display the page after the attribute information to be replaced of the page element is replaced.
The page information replacing device provided by the invention adopts the attribute information of the page elements of the page to be tested in the target environment to replace the attribute information to be replaced of the page elements of the page to be tested in the historical environment in the loading process of the page to be tested, so that the attribute information of the corresponding page elements is the attribute information in the target environment after the page to be tested is rendered and displayed, and the attribute information of the page elements can be directly determined through a voice instruction and a first file which is stored in advance and contains the attribute information of the page elements of the page to be tested, so that a tester does not need to know how to modify the codes of the page to be tested, and can also directly determine the attribute values of the page elements according to the first file and complete the replacement of the attribute values, thereby being beneficial to the test of the tester, enabling the tester to independently complete the replacement of the page elements in different environments without the help of developers, and accelerating the test progress to a certain extent. In addition, the attribute information of the page elements of the tested page in the target environment is determined based on the voice instruction input by the tester, can be directly acquired, is simple and easy to operate for the tester, and enables the testing process to be more efficient.
In one embodiment, the apparatus further comprises:
the configuration module is used for displaying the tested page and the first file on a configuration page; acquiring attribute information of a page element of a page to be detected in the first file from a second file corresponding to a code of the page to be detected;
and the first determining module is used for determining the page elements to be replaced in the page elements in the detected page, the attributes to be replaced of the page elements to be replaced and the attribute values of the page elements to be replaced in the target environment in response to the voice operation instruction of the user to the pre-stored first file containing the attribute information of the page elements of the detected page.
In one embodiment, the determining module comprises:
the first determining unit is used for responding to a first voice control instruction of a tester to the first file, determining page elements to be replaced in the page elements in the tested page, and displaying the attributes of the page elements to be replaced in the page elements and the attribute values of the page elements in the historical environment;
and the second determining unit is used for responding to a second voice control instruction of the tester to the first file, and determining the attribute to be replaced of the page element to be replaced and the attribute value of the page element to be replaced in the target environment.
Fig. 8 is a schematic block diagram of a configuration file generation apparatus provided in the present invention. As shown in fig. 8, the apparatus for generating a configuration file according to the present invention includes:
the display module 810 is configured to display, on the configuration page, the detected page and a first file that is pre-stored and contains attribute information of a page element of the detected page; acquiring attribute information of a page element of a tested page in the first file from a second file corresponding to a code of the tested page;
a second determining module 820, configured to determine, in response to a voice operation instruction of a user on the first file, a page element to be replaced in page elements in the detected page, an attribute to be replaced of the page element to be replaced, and an attribute value of the page element to be replaced in a target environment;
a second replacing module 830, configured to replace the attribute to be replaced of the page element to be replaced and the attribute value thereof in the historical environment based on the attribute to be replaced and the attribute value thereof in the target environment;
a generating module 840, configured to generate a page configuration file of the detected page in the target environment based on the attribute value to be replaced of the replaced page element.
In one embodiment, the second determining module 820 includes:
a third determining unit, configured to determine, in response to a first voice control instruction of a tester to the first file, a page element to be replaced in page elements in the tested page, and display an attribute of the page element to be replaced in the page elements and an attribute value thereof in a historical environment;
and the fourth determining unit is used for responding to a second voice control instruction of the tester to the first file, and determining the attribute to be replaced of the page element to be replaced and the attribute value under the target environment.
In one embodiment, the generating module 840 includes:
and the storage unit is used for responding to a third voice operation instruction of the user and storing the attribute and the attribute value of the replaced page element in a json data mode.
The device for generating the configuration file is characterized in that a configuration page is provided, the tested page and a first file which is pre-stored and contains attribute information of page elements of the tested page are displayed, so that testers can configure attribute values of the corresponding page elements in a target environment conveniently, and attributes to be replaced and attribute values of the attributes to be replaced in the target environment can be determined based on voice operation instructions of the testers, so that a simple method is provided, the testers can independently replace the attribute values of the attributes to be replaced of the page elements, and accordingly the corresponding configuration file is obtained, so that an application program or a webpage can automatically replace the attribute values of the corresponding page elements according to the configuration file during testing in the target environment, the attribute values of the page elements do not need to be manually modified one by one, testing can be efficiently completed, the testers do not need help of developers, the replacement of the page elements in different environments can be independently completed, and page functions in different environments can be tested.
Fig. 9 illustrates a physical structure diagram of an electronic device, and as shown in fig. 9, the electronic device may include: a processor (processor) 910, a communication Interface (Communications Interface) 920, a memory (memory) 930, and a communication bus 940, wherein the processor 910, the communication Interface 920, and the memory 930 are coupled for communication via the communication bus 940. Processor 910 may invoke logic instructions in memory 930 to perform a page information replacement method or a configuration file generation method, wherein the page information replacement method comprises: when a page to be tested is loaded, acquiring attribute information of page elements of the page to be tested in a target environment; the attribute information is determined based on a voice instruction input by a tester and a first file which is stored in advance and contains attribute information of page elements of a tested page; replacing attribute information to be replaced of the page elements of the page to be tested in the historical environment according to the attribute information of the page elements of the page to be tested in the target environment; and after the attribute information to be replaced of the page element is replaced, loading the page to be tested, rendering and displaying. The method for generating the configuration file comprises the following steps: displaying a tested page and a first file which is stored in advance and contains attribute information of page elements of the tested page on a configuration page; acquiring attribute information of a page element of a tested page in the first file from a second file corresponding to a code of the tested page; responding to a voice operation instruction of a user to the first file, and determining a page element to be replaced in page elements in the detected page, attributes to be replaced of the page element to be replaced and attribute values of the page element to be replaced in a target environment; replacing the attribute to be replaced of the page element to be replaced and the attribute value of the page element to be replaced in the historical environment on the basis of the attribute to be replaced and the attribute value of the page element to be replaced in the target environment; and generating a page configuration file of the tested page in the target environment based on the attribute value to be replaced of the replaced page element.
Furthermore, the logic instructions in the memory 930 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, which when executed by a computer, the computer is capable of executing the page information replacing method or the configuration file generating method provided by the present invention, wherein the page information replacing method comprises: when a page to be tested is loaded, acquiring attribute information of page elements of the page to be tested in a target environment; the attribute information to be replaced is determined based on a voice instruction input by a tester and a first file which is stored in advance and contains attribute information of a page element of a tested page; replacing attribute information to be replaced of the page elements of the page to be tested in the historical environment according to the attribute information of the page elements of the page to be tested in the target environment; and after the attribute information to be replaced of the page element is replaced, loading the tested page, rendering and displaying. The method for generating the configuration file comprises the following steps: displaying a tested page and a first file which is stored in advance and contains attribute information of page elements of the tested page on a configuration page; acquiring attribute information of a page element of a page to be detected in the first file from a second file corresponding to a code of the page to be detected; responding to a voice operation instruction of a user to the first file, and determining a page element to be replaced in page elements in the detected page, attributes to be replaced of the page element to be replaced and attribute values of the page element to be replaced in a target environment; replacing the attribute to be replaced of the page element to be replaced and the attribute value of the page element to be replaced in the historical environment on the basis of the attribute to be replaced and the attribute value of the page element to be replaced in the target environment; and generating a page configuration file of the tested page in the target environment based on the attribute value to be replaced of the replaced page element.
In still another aspect, the present invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program, which when executed by a processor is implemented to perform the page information replacement method or the configuration file generation method provided by the present invention, wherein the page information replacement method includes: when a page to be tested is loaded, acquiring attribute information of page elements of the page to be tested in a target environment; the attribute information to be replaced is determined based on a voice instruction input by a tester and a first file which is stored in advance and contains attribute information of a page element of a tested page; replacing attribute information to be replaced of the page elements of the page to be tested in the historical environment according to the attribute information of the page elements of the page to be tested in the target environment; and after the attribute information to be replaced of the page element is replaced, loading the page to be tested, rendering and displaying. The method for generating the configuration file comprises the following steps: displaying a tested page and the first file on a configuration page; acquiring attribute information of a page element of a page to be detected in the first file from a second file corresponding to a code of the page to be detected; responding to a voice operation instruction of a user to the pre-stored first file containing the attribute information of the page elements of the tested page, and determining the page elements to be replaced in the page elements in the tested page, the attributes to be replaced of the page elements to be replaced and the attribute values of the page elements to be replaced in the target environment; replacing the attribute to be replaced of the page element to be replaced and the attribute value of the page element to be replaced in the historical environment on the basis of the attribute to be replaced and the attribute value of the page element to be replaced in the target environment; and generating a page configuration file of the tested page in the target environment based on the attribute value to be replaced of the replaced page element.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, and not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for replacing page information, the method comprising:
when a page to be tested is loaded, acquiring attribute information of page elements of the page to be tested in a target environment; the attribute information is determined based on a voice instruction input by a tester and a first file which is stored in advance and contains the attribute information of the page element of the tested page;
replacing attribute information to be replaced of the page elements of the page to be tested in the historical environment according to the attribute information of the page elements of the page to be tested in the target environment;
and after the attribute information to be replaced of the page element is replaced, loading the tested page, rendering and displaying.
2. The method for replacing page information according to claim 1, wherein the process of determining the attribute information of the page element of the page under test in the target environment comprises:
displaying a tested page and the first file on a configuration page; acquiring attribute information of a page element of a page to be detected in the first file from a second file corresponding to a code of the page to be detected;
and responding to a voice operation instruction of a user to the first file, and determining a page element to be replaced, a property to be replaced of the page element to be replaced and an attribute value of the page element to be replaced in a target environment.
3. The method for replacing page information according to claim 2, wherein the page elements to be replaced among the page elements in the tested page, the attributes to be replaced of the page elements to be replaced and the attribute values thereof in the target environment are determined in response to a voice operation instruction of a user to the first file; the method comprises the following steps:
responding to a first voice control instruction of a tester to the first file, determining page elements to be replaced in the page elements in the tested page, and displaying the attributes of the page elements to be replaced and the attribute values of the page elements in the historical environment;
and responding to a second voice control instruction of the tester to the first file, and determining the attribute to be replaced of the page element to be replaced and the attribute value of the page element to be replaced in the target environment.
4. A method for generating a configuration file, the method comprising:
displaying a tested page and a first file which is stored in advance and contains attribute information of page elements of the tested page on a configuration page; acquiring attribute information of a page element of a page to be detected in the first file from a second file corresponding to a code of the page to be detected;
responding to a voice operation instruction of a user to the first file, and determining a page element to be replaced in page elements in the detected page, attributes to be replaced of the page element to be replaced and attribute values of the page element to be replaced in a target environment;
replacing the attribute to be replaced of the page element to be replaced and the attribute value of the page element to be replaced in the historical environment on the basis of the attribute to be replaced and the attribute value of the page element to be replaced in the target environment;
and generating a page configuration file of the tested page in the target environment based on the attribute value to be replaced of the replaced page element.
5. The method for generating a configuration file according to claim 4, wherein the determining, in response to a voice operation instruction of a user to the pre-stored first file containing attribute information of page elements of a page to be tested, a page element to be replaced among the page elements in the page to be tested, an attribute to be replaced of the page element to be replaced, and an attribute value thereof in a target environment includes:
responding to a first voice control instruction of a tester to the first file, determining page elements to be replaced in the page elements in the tested page, and displaying the attributes of the page elements to be replaced and the attribute values of the page elements in the historical environment;
and responding to a second voice control instruction of the tester to the first file, and determining the attribute to be replaced of the page element to be replaced and the attribute value under the target environment.
6. The method for generating a configuration file according to claim 4 or 5, wherein the generating a page configuration file of the tested page in a target environment based on the attribute value to be replaced of the replaced page element comprises:
and responding to a third voice operation instruction of the user, and storing the attribute and the attribute value of the replaced page element in a json data form.
7. A page information replacing apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring the attribute information of the page elements of the page to be tested in the target environment when the page to be tested is loaded; the attribute information is determined based on a voice instruction input by a tester and a first file which is stored in advance and contains the attribute information of the page element of the tested page;
the first replacement module is used for replacing attribute information to be replaced of the page elements of the page to be tested in the historical environment according to the attribute information of the page elements of the page to be tested in the target environment;
and the processing module is used for loading the tested page and rendering and displaying the page after the attribute information to be replaced of the page element is replaced.
8. An apparatus for generating a configuration file, the apparatus comprising:
the display module is used for displaying the tested page and a first file which is stored in advance and contains the attribute information of the page element of the tested page on the configuration page; acquiring attribute information of a page element of a tested page in the first file from a second file corresponding to a code of the tested page;
the determining module is used for responding to a voice operation instruction of a user to the first file, and determining a page element to be replaced in the page elements in the detected page, the attribute to be replaced of the page element to be replaced and the attribute value of the page element to be replaced in a target environment;
the second replacement module is used for replacing the attribute to be replaced of the page element to be replaced and the attribute value of the page element to be replaced in the historical environment on the basis of the attribute to be replaced and the attribute value of the page element to be replaced in the target environment;
and the generating module is used for generating a page configuration file of the detected page in the target environment based on the attribute value to be replaced of the replaced page element.
9. A computer device comprising a memory and a processor, wherein the memory has stored therein computer readable instructions, which, when executed by the processor, cause the processor to carry out the steps of the page information replacement method or the method for generating a configuration file according to any one of claims 1 to 6.
10. A storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the page information replacement method or the generation method of the configuration file according to any one of claims 1 to 6.
CN202210995097.9A 2022-08-18 2022-08-18 Page information replacement method and device and configuration file generation method and device Pending CN115292646A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210995097.9A CN115292646A (en) 2022-08-18 2022-08-18 Page information replacement method and device and configuration file generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210995097.9A CN115292646A (en) 2022-08-18 2022-08-18 Page information replacement method and device and configuration file generation method and device

Publications (1)

Publication Number Publication Date
CN115292646A true CN115292646A (en) 2022-11-04

Family

ID=83830414

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210995097.9A Pending CN115292646A (en) 2022-08-18 2022-08-18 Page information replacement method and device and configuration file generation method and device

Country Status (1)

Country Link
CN (1) CN115292646A (en)

Similar Documents

Publication Publication Date Title
US10866788B2 (en) System and method for automated generation of integration elements modeling process flow for an integration process with a swagger API
CN103518393B (en) The system and method for detecting mobile communication equipment content
CN109325195A (en) Rendering method and system, computer equipment, the computer storage medium of browser
CN105868096B (en) For showing the method, device and equipment of web page test result in a browser
CN110221968A (en) Method for testing software and Related product
US9875096B2 (en) Systems and methods for software scanning tool
CN105446874A (en) Method and device for detecting resource configuration file
US11741002B2 (en) Test automation systems and methods using logical identifiers
CN109783355A (en) Page elements acquisition methods, system, computer equipment and readable storage medium storing program for executing
CN112214210A (en) Logistics business rule engine and configuration method, device, equipment and storage medium thereof
US11422783B2 (en) Auto-deployment of applications
CN104809053A (en) Control style testing method and device
GB2553896B (en) Product test orchestration
CN112506503A (en) Programming method, device, terminal equipment and storage medium
CN114816772B (en) Debugging method, debugging system and computing device for application running based on compatible layer
CN115292646A (en) Page information replacement method and device and configuration file generation method and device
CN111008058A (en) Page display method and device
CN107766228A (en) It is a kind of based on multilingual automated testing method and device
CN108733279A (en) Drop-down list display methods and device
CN112433778A (en) Mobile equipment page display method and device, electronic equipment and storage medium
CN110175116B (en) Test date switching method, device and system
CN110244934A (en) Product demand document, the generation method and device for testing information
CN117008890B (en) Extended application development system and method
CN109800155B (en) Method and device for testing QTE interlocking application software based on Probe
CN112559311B (en) Interface adaptation method and device for mobile terminal automatic test

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