Disclosure of Invention
The application provides a method and a device for starting a test page, which at least solve the technical problem of low efficiency of starting a page to be tested in the page test process in the related technology.
According to one aspect of the embodiment of the application, there is provided a method for starting a test page, including:
Acquiring target page parameters, wherein the target page parameters are used for indicating a page path of a page to be tested;
Generating a starting code, wherein the starting code is used for calling a preset function, and the preset function is used for starting a page;
Adding the target page parameters into the starting codes to obtain starting applications;
and starting the page to be tested through the starting application.
Optionally, generating the start application using the target page parameter includes:
Generating a starting code, wherein the starting code is used for calling a preset function, and the preset function is used for starting a page;
And adding the target page parameters into the starting codes to obtain the starting application.
Optionally, the step of starting the page to be tested through the starting application includes:
Generating a starting request through the starting application, wherein the starting request is used for requesting the preset function to start the page to be tested, and the starting request carries the target page parameters;
and sending the starting request to a preset function.
Optionally, generating, by the launch application, a launch request includes:
running the starting application;
And acquiring the starting request generated by the starting application.
Optionally, after sending the start request to a preset function, the method further includes:
responding to the starting request to execute the preset function;
Starting a target application indicated by a first parameter in the target page parameters through the preset function, wherein the target application is an application to which the page to be tested belongs;
loading the page to be tested indicated by a second parameter in the target page parameters through the preset function;
and under the condition that the page to be tested is detected to be displayed on the target application, determining that the page to be tested is started.
Optionally, obtaining the target page parameter includes:
acquiring input page parameters;
Storing the page parameters in a preset file;
And extracting the target page parameters from the preset file.
Optionally, extracting the target page parameter from the preset file includes:
Acquiring a target parameter identifier indicated by the preset function, wherein the target parameter identifier is used for identifying page parameters used for calling the preset function starting page;
searching the target parameter identification from the parameter identification and the parameter value which are recorded in the preset file and have the corresponding relation;
And under the condition that the target parameter identification is found, extracting a target parameter value corresponding to the target parameter identification from the preset file as the target page parameter.
Optionally, after the page to be tested is started by the starting application, the method further includes:
calling a test application;
and testing the page to be tested through the test application.
According to another aspect of the embodiment of the present application, there is also provided a device for starting a test page, including:
the acquisition module is used for acquiring target page parameters, wherein the target page parameters are used for indicating a page path of a page to be tested;
The generation module is used for generating a starting code, wherein the starting code is used for calling a preset function, and the preset function is used for starting the page;
The adding module is used for adding the target page parameters into the starting codes to obtain starting applications;
And the first starting module is used for starting the page to be tested through the starting application.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program that executes the above-described method when running.
According to another aspect of the embodiments of the present application, there is also provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor executing the method described above by the computer program.
In the embodiment of the application, acquiring a target page parameter, wherein the target page parameter is used for indicating a page path of a page to be tested; generating a starting code, wherein the starting code is used for calling a preset function, and the preset function is used for starting a page; adding the target page parameters into a starting code to obtain a starting application; the method comprises the steps that a target page parameter for indicating a page path of a page to be tested is obtained through a mode of starting the application, the target page parameter is used for generating a starting application, the starting application can directly find and start the page to be tested through the page path of the page to be tested, so that the page to be tested is not opened by clicking a button in a page test process, but is opened by directly finding the page path of the page to be tested, and the page is not required to be started manually, so that the technical effect of improving the efficiency of starting the page to be tested in the page test process is achieved, and the technical problem that the efficiency of starting the page to be tested in the page test process in the related technology is lower is solved.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiment of the application, a method embodiment for starting a test page is provided.
Alternatively, in the present embodiment, the above-described method for starting a test page may be applied to a hardware environment composed of the terminal 101 and the server 103 as shown in fig. 1. As shown in fig. 1, the server 103 is connected to the terminal 101 through a network, which may be used to provide services (such as game services, application services, etc.) to the terminal or clients installed on the terminal, and a database may be provided on the server or independent of the server, for providing data storage services to the server 103, where the network includes, but is not limited to: the terminal 101 is not limited to a PC, a mobile phone, a tablet computer, or the like. The method for starting the test page according to the embodiment of the present application may be executed by the server 103, may be executed by the terminal 101, or may be executed by both the server 103 and the terminal 101. The method for starting the terminal 101 to execute the test page according to the embodiment of the present application may also be executed by the client installed thereon.
FIG. 2 is a flowchart of an alternative method of launching a test page, as shown in FIG. 2, according to an embodiment of the present application, which may include the steps of:
step S202, acquiring target page parameters, wherein the target page parameters are used for indicating a page path of a page to be tested;
Step S204, generating a starting code, wherein the starting code is used for calling a preset function, and the preset function is used for starting a page;
Step S206, adding the target page parameters to the starting codes to obtain starting applications;
Step S208, starting the page to be tested through the starting application.
Through the steps S202 to S208, the target page parameter for indicating the page path of the page to be tested is obtained, and the starting application is generated by using the target page parameter, and the starting application can directly find and start the page to be tested through the page path of the page to be tested, so that the page to be tested is not opened by clicking individual buttons in the page testing process, but is opened by directly finding the page path of the page to be tested, and the page is not required to be started manually, thereby realizing the technical effect of improving the efficiency of starting the page to be tested in the page testing process, and further solving the technical problem of lower efficiency of starting the page to be tested in the page testing process in the related technology.
Alternatively, in this embodiment, the method for starting the test page may be applied to a scenario of page testing, but is not limited to the method for starting the test page. Such as: the method for starting the test page can be applied to page test software, test plug-ins, test clients and the like, but is not limited to the method.
In the technical solution provided in step S202, the target page parameter is used to indicate a page path of the page to be tested. Such as: the target page parameters may include, but are not limited to, page addresses including pages to be tested, URLs (Uniform Resource Locator, uniform resource locators), IP (Internet Protocol ) addresses, and the like.
Optionally, in this embodiment, the manner of acquiring the target page parameter may include, but is not limited to: receiving character information input in an input box, reading a file, and the like.
In the technical solution provided in step S204, the start code may, but is not limited to, play a role of automatically accessing the page path of the page to be tested by calling a preset function, so as to directly start the page to be tested.
Alternatively, in the present embodiment, the preset function is a function capable of completing an operation of starting a page. Such as: the preset function may be, but is not limited to, an Intent function including an Android system.
In the technical solution provided in step S206, the launching application may be, but is not limited to, a plug-in, a client, a code, a script, etc. And generating a starting application by using the acquired target page parameters, and accessing a page path of the page to be tested by calling the starting application, so that the aim of directly starting the page to be tested is fulfilled.
Alternatively, in the present embodiment, adding the target page parameter to the boot code may, but is not limited to, configuring the page parameter such as the page path of the page to be tested to the corresponding position of the boot code. Such as: a fixed code format may be set in the start code for recording the individual page parameters of the page to be tested. The parameters can also be added to the corresponding positions according to the requirements of the preset functions.
In an alternative embodiment, a manner of generating a startup application is provided, and fig. 3 is a schematic diagram of generating a startup application according to an alternative embodiment of the present application, as shown in fig. 3, a code in a dashed box may be considered as the startup code, where the startup code includes a code statement for calling an intelt function of an Android system and a code statement for providing a target page parameter for the intelt function. Target page parameters provided for the Intint function may include, but are not limited to: -W, -n, com.xxx.jrapp/. Bm.main box.main.mainactivity, -d, and openXXXjrapp: v/www.XXX.comjrcontainer =h5 & jrlogin =false, etc., where the parameter "openXXXjrapp: the// www.XXX.comjrcontainer =h5 & jrlogin =false "is used to indicate the page path of the page to be tested. The parameter "com.XXX.jrapp/. Bm.main box.main.MainActivity" is used to launch the APP. The parameter "-W" is used to wait for the output page load time after the page load is completed, and may be default. The parameter "-n" is used for loading the page to be tested after starting the APP, and if the parameter is not available, the APP can only be started. Parameter "-d" is used to specify the page to be opened after the APP is evoked, and this parameter may be default.
In the technical solution provided in step S208, the manner of starting the page to be tested by the starting application may, but is not limited to, including directly accessing the page path of the page to be tested, and calling the system function with the function of starting the page to access the page path of the page to be tested.
As an optional embodiment, the launching the page to be tested by the launching application includes:
s11, generating a starting request through the starting application, wherein the starting request is used for requesting the preset function to start the page to be tested, and the starting request carries the target page parameters;
S12, sending the starting request to a preset function.
Alternatively, in the present embodiment, the startup application may call a preset function by a startup request, but is not limited to.
Optionally, in this embodiment, the target page parameter is carried in the start request and sent to the preset function, so that the preset function can know the information of the page to be tested through the target page parameter, and thus the page to be tested is opened.
As an alternative embodiment, generating the start request by the start application comprises:
s21, running the starting application;
s22, acquiring the starting request generated by the starting application.
Alternatively, in this embodiment, the running start application can automatically generate a start request that can be identified by a preset function by starting a start code in the application.
Alternatively, in the present embodiment, the information format of the start request may be set according to a preset function, but is not limited thereto.
As an alternative embodiment, after sending the start request to a preset function, the method further comprises
S31, responding to the starting request to execute the preset function;
S32, starting a target application indicated by a first parameter in the target page parameters through the preset function, wherein the target application is an application to which the page to be tested belongs;
S33, loading the page to be tested indicated by a second parameter in the target page parameters through the preset function;
And S34, under the condition that the page to be tested is detected to be displayed on the target application, determining that the page to be tested is started.
Optionally, in this embodiment, the startup application provides a startup request carrying a target page parameter to the intelt function, the intelt function describes a page to be tested through the page parameters, and the Android system finds a corresponding page to be tested according to the description of the intelt, transfers the description content of the intelt to the called page to be tested, and completes the opening action of the page to be tested.
Optionally, in this embodiment, the target page parameters may include, but are not limited to: the system comprises a first parameter, a second parameter and the like, wherein the first parameter is used for indicating a target application where a page to be tested is located, and the second parameter is a page path of the page to be tested. Such as: in the above alternative embodiment, the parameter "com.xxx.jrapp/. Bm.main box.main.mainactivity" corresponds to the above first parameter, parameter "openXXXjrapp: the// www.XXX.comjrcontainer =h5 & jrlogin =false "corresponds to the second parameter described above.
Optionally, in this embodiment, the manner of starting the page to be tested through the preset function may, but is not limited to, starting the target application where the page to be tested is located first, and then starting the page to be tested in the target application.
As an alternative embodiment, obtaining the target page parameters includes
S41, acquiring input page parameters;
s42, storing the page parameters in a preset file;
S43, extracting the target page parameters from the preset file.
Optionally, in this embodiment, a preset file is set to store the acquired page parameters. The entered page parameters may be provided by, but are not limited to, the proposed party required for the test.
Alternatively, in this embodiment, the manner of extracting the target page parameters from the preset file may be, but not limited to, extracting one by one according to the stored order, or may be extracting according to the test requirement.
As an optional embodiment, extracting the target page parameter from the preset file includes:
S51, acquiring a target parameter identifier indicated by the preset function, wherein the target parameter identifier is used for identifying page parameters used for calling the preset function starting page;
S52, searching the target parameter identification from the parameter identification and the parameter value which are recorded in the preset file and have the corresponding relation;
and S53, under the condition that the target parameter identifier is found, extracting a target parameter value corresponding to the target parameter identifier from the preset file as the target page parameter.
Alternatively, in the present embodiment, the page parameters may be recorded in the preset file in the form of recording the parameter identifiers and parameter values having the correspondence relationship, but not limited to. For example: the parameter identification and the parameter value with the corresponding relation can be stored in the form of key value pairs, the parameter identification is used as a key, and the parameter value is used as a value.
Alternatively, in the present embodiment, the parameter value may be extracted from the preset file as the target page parameter according to the requirement of the preset function, but is not limited to. The target parameter identification is used for identifying page parameters used for calling the preset function starting page.
Optionally, in this embodiment, when extracting the target page parameter in the preset file, the target parameter identifier may be first used as a key to search for the target parameter identifier in the parameter identifier recorded in the preset file, and if the target parameter identifier is found, the corresponding target parameter value is obtained in the preset file and is used as the target page parameter to be added to the start code.
As an optional embodiment, after the page to be tested is started by the starting application, the method further comprises
S61, calling a test application;
S62, testing the page to be tested through the test application.
Optionally, in this embodiment, after the page to be tested is started, the page to be tested may be automatically tested by calling the test application, so as to implement full automation of the test process.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present application is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present application.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
According to another aspect of the embodiment of the application, a device for starting the test page is also provided. FIG. 4 is a schematic diagram of an alternative test page launching device, as shown in FIG. 4, according to an embodiment of the present application, which may include:
An obtaining module 42, configured to obtain a target page parameter, where the target page parameter is used to indicate a page path of a page to be tested;
a generating module 44, configured to generate a start code, where the start code is used to invoke a preset function, and the preset function is used to start a page;
an adding module 46, configured to add the target page parameter to the start code, to obtain a start application;
a first starting module 48 is configured to start the page to be tested through the starting application.
It should be noted that, the acquiring module 42 in this embodiment may be used to perform step S202 in the embodiment of the present application, the generating module 44 in this embodiment may be used to perform step S204 in the embodiment of the present application, the adding module 46 in this embodiment may be used to perform step S206 in the embodiment of the present application, the first starting module 48 in this embodiment may be used to perform step S208 in the embodiment of the present application,
It should be noted that the above modules are the same as examples and application scenarios implemented by the corresponding steps, but are not limited to what is disclosed in the above embodiments. It should be noted that the above modules may be implemented in software or hardware as a part of the apparatus in the hardware environment shown in fig. 1.
Through the module, the target page parameters for indicating the page paths of the pages to be tested are obtained, the target page parameters are used for generating the starting application, and the starting application can directly find and start the pages to be tested through the page paths of the pages to be tested, so that the pages to be tested are not opened by clicking individual buttons in the page testing process, but are opened by directly finding the page paths of the pages to be tested, and the pages are not required to be started manually, thereby realizing the technical effect of improving the efficiency of starting the pages to be tested in the page testing process, and further solving the technical problem of lower efficiency of starting the pages to be tested in the page testing process in the related technology.
As an alternative embodiment, the first starting module includes:
the generation unit is used for generating a starting request through the starting application, wherein the starting request is used for requesting the preset function to start the page to be tested, and the starting request carries the target page parameters;
and the sending unit is used for sending the starting request to a preset function.
As an alternative embodiment, the generating unit is configured to:
running the starting application;
And acquiring the starting request generated by the starting application.
As an alternative embodiment, the apparatus further comprises:
The execution module is used for responding to the starting request to execute the preset function after the starting request is sent to the preset function;
The second starting module is used for starting a target application indicated by a first parameter in the target page parameters through the preset function, wherein the target application is an application to which the page to be tested belongs;
The loading module is used for loading the page to be tested indicated by a second parameter in the target page parameters through the preset function;
And the determining module is used for determining that the page to be tested is started under the condition that the page to be tested is detected to be displayed on the target application.
As an alternative embodiment, the acquiring module includes:
The acquisition unit is used for acquiring the input page parameters;
The storage unit is used for storing the page parameters in a preset file;
And the extracting unit is used for extracting the target page parameters from the preset file.
As an alternative embodiment, the extraction unit is configured to:
Acquiring a target parameter identifier indicated by the preset function, wherein the target parameter identifier is used for identifying page parameters used for calling the preset function starting page;
searching the target parameter identification from the parameter identification and the parameter value which are recorded in the preset file and have the corresponding relation;
And under the condition that the target parameter identification is found, extracting a target parameter value corresponding to the target parameter identification from the preset file as the target page parameter.
As an alternative embodiment, the apparatus further comprises:
The calling module is used for calling the test application after the page to be tested is started by the starting application;
and the test module is used for testing the page to be tested through the test application.
It should be noted that the above modules are the same as examples and application scenarios implemented by the corresponding steps, but are not limited to what is disclosed in the above embodiments. It should be noted that the above modules may be implemented in software or in hardware as part of the apparatus shown in fig. 1, where the hardware environment includes a network environment.
According to another aspect of the embodiment of the application, a server or a terminal for implementing the method for starting the test page is also provided.
Fig. 5 is a block diagram of a terminal according to an embodiment of the present application, and as shown in fig. 5, the terminal may include: one or more (only one is shown in the figure) processors 501, memory 503, and transmission means 505, as shown in fig. 5, the terminal may further comprise input output devices 507.
The memory 503 may be used to store software programs and modules, such as program instructions/modules corresponding to the method and apparatus for starting a test page in the embodiment of the present application, and the processor 501 executes the software programs and modules stored in the memory 503, thereby executing various functional applications and data processing, that is, implementing the method for starting a test page. Memory 503 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory. In some examples, the memory 503 may further include memory located remotely from the processor 501, which may be connected to the terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 505 is used for receiving or transmitting data via a network, and may also be used for data transmission between the processor and the memory. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 505 includes a network adapter (Network Interface Controller, NIC) that may be connected to other network devices and routers via a network cable to communicate with the internet or a local area network. In one example, the transmission device 505 is a Radio Frequency (RF) module, which is used to communicate with the internet wirelessly.
Wherein in particular the memory 503 is used for storing application programs.
The processor 501 may call an application stored in the memory 503 via the transmission means 505 to perform the following steps:
Acquiring target page parameters, wherein the target page parameters are used for indicating a page path of a page to be tested;
Generating a starting code, wherein the starting code is used for calling a preset function, and the preset function is used for starting a page;
Adding the target page parameters into the starting codes to obtain starting applications;
and starting the page to be tested through the starting application.
By adopting the embodiment of the application, a scheme for starting the test page is provided. The method comprises the steps of obtaining target page parameters for indicating the page paths of the pages to be tested, generating a starting application by using the target page parameters, and directly finding and starting the pages to be tested through the page paths of the pages to be tested, so that the pages to be tested are not opened by clicking individual buttons in the page test process, but are opened by directly finding the page paths of the pages to be tested, and the pages are not required to be started manually, thereby realizing the technical effect of improving the efficiency of starting the pages to be tested in the page test process, and further solving the technical problem of lower efficiency of starting the pages to be tested in the page test process in the related technology.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the structure shown in fig. 5 is only illustrative, and the terminal may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile internet device (Mobile INTERNET DEVICES, MID), a PAD, etc. Fig. 5 is not limited to the structure of the electronic device. For example, the terminal may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in fig. 5, or have a different configuration than shown in fig. 5.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a program for instructing a terminal device to execute in association with hardware, the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
The embodiment of the application also provides a storage medium. Alternatively, in the present embodiment, the above-described storage medium may be used for executing the program code of the start-up method of the test page.
Alternatively, in this embodiment, the storage medium may be located on at least one network device of the plurality of network devices in the network shown in the above embodiment.
Alternatively, in the present embodiment, the storage medium is configured to store program code for performing the steps of:
Acquiring target page parameters, wherein the target page parameters are used for indicating a page path of a page to be tested;
Generating a starting code, wherein the starting code is used for calling a preset function, and the preset function is used for starting a page;
Adding the target page parameters into the starting codes to obtain starting applications;
and starting the page to be tested through the starting application.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments, and this embodiment is not described herein.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
The integrated units in the above embodiments may be stored in the above-described computer-readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing one or more computer devices (which may be personal computers, servers or network devices, etc.) to perform all or part of the steps of the method described in the embodiments of the present application.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In several embodiments provided by the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown 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 units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application, which are intended to be comprehended within the scope of the present application.