Disclosure of Invention
The application provides a test page starting method and device, which are used for at least solving the technical problem of low efficiency of starting a page to be tested in a page test process in the related technology.
According to an aspect of an embodiment of the present application, there is provided a method for starting a test page, including:
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 parameter into the starting code to obtain a starting application;
and starting the page to be tested through the starting application.
Optionally, the generating the start-up application by 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 parameter into the starting code to obtain the starting application.
Optionally, the starting the page to be tested by 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 parameter;
and sending the starting request to a preset function.
Optionally, the generating of the start request by the start application includes:
running the start-up application;
and acquiring the starting request generated by the starting application.
Optionally, after sending the start request to the 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, the 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, the 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 a page parameter used for calling the preset function starting page;
searching the target parameter identification from the parameter identification and the parameter value which are recorded by 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 start 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 embodiments of the present application, there is also provided a device for starting a test page, including:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring a target page parameter, and the target page parameter is used for indicating a page path of a page to be tested;
the system comprises a generating module, a starting module and a starting module, wherein the generating module is used for generating a starting code, the starting code is used for calling a preset function, and the preset function is used for starting a 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 which, when executed, performs the above-described method.
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, wherein the processor executes the above method through the computer program.
In the embodiment of the application, target page parameters are obtained, wherein the target page parameters are used for indicating the 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 parameter into the starting code to obtain a starting application; the method comprises the steps of obtaining a target page parameter for indicating a page path of a page to be tested by starting an application to start the page to be tested, generating a starting application by using the target page parameter, wherein 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 in the page testing process, the page to be tested is not opened by clicking a button one by one, but the page path of the page to be tested is directly found to open the page, and the page is not required to be manually started, 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.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or 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 an embodiment of the present application, an embodiment of a method for starting a test page is provided.
Alternatively, in this embodiment, the method for starting the test page may be applied to a hardware environment formed by the terminal 101 and the server 103 as shown in fig. 1. As shown in fig. 1, a server 103 is connected to a terminal 101 through a network, which may be used to provide services (such as game services, application services, etc.) for the terminal or a client installed on the terminal, and a database may be provided on the server or separately from the server for providing data storage services for the server 103, and the network includes but is not limited to: the terminal 101 is not limited to a PC, a mobile phone, a tablet computer, and the like. The test page starting method in the embodiment of the present application may be executed by the server 103, the terminal 101, or both the server 103 and the terminal 101. The method for the terminal 101 to start the test page according to the embodiment of the present application may be executed by a client installed thereon.
Fig. 2 is a flowchart of an optional method for starting a test page according to an embodiment of the present application, and as shown in fig. 2, the method may include the following steps:
step S202, acquiring a target page parameter, wherein the target page parameter is 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 parameter into the starting code to obtain a starting application;
and 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, the start application is generated by using the target page parameter, and the start application can directly find and start the page to be tested through the page path of the page to be tested, so that in the page testing process, the page to be tested is not opened by clicking a button one by one, but the page path of the page to be tested is directly found to open the page, and the page does not need to be manually started, 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 low efficiency of starting the page to be tested in the page testing process in the related art.
Optionally, in this embodiment, the method for starting the test page may be applied to a scenario of page test, but is not limited to the scenario, so as to start the test page. Such as: the starting method of the test page can be applied to page test software, test plug-ins, test clients and the like.
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, a page address of the page to be tested, a URL (Uniform resource locator), an IP (Internet Protocol) address, and the like.
Optionally, in this embodiment, the manner of obtaining the target page parameter may include, but is not limited to: receiving character information input in the 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 a page path of the page to be tested by calling a preset function, so as to directly start the page to be tested.
Optionally, in this embodiment, the preset function is a function capable of completing an operation of starting a page. Such as: the preset function may include, but is not limited to, an Intent function of the Android system.
In the technical solution provided in step S206, the start application may be, but is not limited to, a plug-in, a client, a code, a script, and the like. 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, thereby achieving the purpose of directly starting the page to be tested.
Optionally, in this embodiment, adding the target page parameter to the boot code may be, but is not limited to, configuring a page parameter such as a page path of the page to be tested to a corresponding position of the boot code. Such as: a fixed code format may be set in the boot code for recording various page parameters of the page to be tested. Or each parameter can be added to the corresponding position according to the requirement of the preset function.
In an alternative embodiment, a manner of generating a start-up application is provided, and fig. 3 is a schematic diagram of generating a start-up application according to an alternative embodiment of the present application, and as shown in fig. 3, a code in a dashed box may be regarded as the start-up code, where the start-up code includes a code statement for calling an Intent function of an Android system and a code statement for providing a target page parameter for the Intent function. The target page parameters provided for Intent functionality may include, but are not limited to: -W, -n, com.xxx.jrapp/. bm.mainbox.main.mainactivity, -d and openXXXjrapp: // www.XXX.com? jrcontainer h5& jrlogin false, etc., wherein the parameters "openxxjrapp: // www.XXX.com? jrcontainer h5& jrlogin false "is used to indicate the page path of the page to be tested. The parameter "com.xxx.jrapp/. bm.mainbox.main.mainactivity" is used to start APP. The parameter "-W" is used to output the page load time after waiting for the page load to complete, and may be a default. And the parameter "-n" is used for loading the page to be tested after the APP is started, and if the parameter does not exist, only the APP can be started. The parameter "-d" is used to specify the page to be opened after the APP is evoked, and may be default.
In the technical solution provided in step S208, the method for starting the page to be tested by starting the application may include, but is not limited to, directly accessing the page path of the page to be tested, and calling a system function having a 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 launch 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 parameter;
and S12, sending the starting request to a preset function.
Optionally, in this embodiment, the start application may, but is not limited to, call a preset function by a start request.
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, the generating of the launch request by the launch application includes:
s21, running the starting application;
s22, obtaining the starting request generated by the starting application.
Optionally, in this embodiment, the running of the start-up application can automatically generate a start-up request that can be recognized by the preset function through the start-up code in the start-up application.
Optionally, in this embodiment, the information format of the start request may be, but is not limited to, set according to a preset function.
As an optional embodiment, after sending the start request to the preset function, the method further includes
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 the second parameter in the target page parameters through the preset function;
s34, 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.
Optionally, in this embodiment, the start application provides a start request carrying target page parameters to the Intent function, the Intent function describes the page to be tested through the page parameters, and the Android system finds the corresponding page to be tested according to the description of the Intent, transmits the description content of the Intent 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.mainbox.main. mainactivity" corresponds to the above first parameter, parameter "openXXXjrapp: // www.XXX.com? jrcontainer h5& jrlogin false "corresponds to the second parameter.
Optionally, in this embodiment, the method for starting the page to be tested through the preset function may be, 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 parameters of the target page includes
S41, acquiring input page parameters;
s42, storing the page parameters in a preset file;
and 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, but are not limited to, being provided by the presenter of the test requirements.
Optionally, in this embodiment, the manner of extracting the target page parameter from the preset file may be, but is not limited to, extracting one by one according to a storage sequence, and may also be extracting according to a test requirement.
As an optional embodiment, the 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 a page parameter 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 by 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.
Optionally, in this embodiment, the preset file may record, but is not limited to record, the page parameters in a form of recording parameter identifiers and parameter values having corresponding relationships. For example: the parameter identifier and the parameter value having the correspondence may be stored in the form of a key-value pair, with the parameter identifier as a key and the parameter value as a value.
Optionally, in this embodiment, the parameter value may be, but is not limited to, extracted from a preset file as the target page parameter according to the requirement of the preset function. The target parameter identification is used for identifying a page parameter used for calling the preset function starting page.
Optionally, in this embodiment, when extracting the target page parameter from the preset file, the target parameter identifier may be first searched in the parameter identifier recorded in the preset file with the target parameter identifier as a key, and if the target parameter identifier is found, the corresponding target parameter value is obtained in the preset file and added to the start code as the target page parameter.
As an optional embodiment, after the page to be tested is started by the start application, the method further includes
S61, calling a test application;
s62, testing the page to be tested through the testing 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 that full automation of the test process is achieved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
According to another aspect of the embodiment of the present application, there is also provided a test page starting apparatus for implementing the test page starting method. Fig. 4 is a schematic diagram of an alternative test page initiation apparatus according to an embodiment of the present application, and as shown in fig. 4, the apparatus 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 boot code, so as to obtain a boot application;
a first starting module 48, configured to start the page to be tested through the starting application.
It should be noted that the obtaining module 42 in this embodiment may be configured to execute the step S202 in this embodiment, the generating module 44 in this embodiment may be configured to execute the step S204 in this embodiment, the adding module 46 in this embodiment may be configured to execute the step S206 in this embodiment, the first starting module 48 in this embodiment may be configured to execute the step S208 in this embodiment,
it should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may operate in a hardware environment as shown in fig. 1, and may be implemented by software or hardware.
Through the module, the target page parameter used for indicating the page path of the page to be tested is obtained, the starting application is generated by using the target page parameter, and the starting application can be directly found and start the page to be tested through the page path of the page to be tested, so that in the page testing process, the page to be tested is not opened by clicking a button one by one, but the page path of the page to be tested is directly found to open the page, and the page is not required to be manually started, therefore, the technical effect of improving the efficiency of starting the page to be tested in the page testing process is achieved, and the technical problem that the efficiency of starting the page to be tested in the page testing process in the related technology is low is solved.
As an alternative embodiment, the first starting module comprises:
a generating unit, configured to generate a start request through the start application, where the start request is used to request the preset function to start the page to be tested, and the start request carries the target page parameter;
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 start-up 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 the target application indicated by the first parameter in the target page parameters through the preset function, wherein the target application is the application to which the page to be tested belongs;
the loading module is used for loading the page to be tested indicated by the 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 obtaining module includes:
the acquisition unit is used for acquiring input page parameters;
the storage unit is used for storing the page parameters in a preset file;
and the extraction 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 a page parameter used for calling the preset function starting page;
searching the target parameter identification from the parameter identification and the parameter value which are recorded by 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 through the starting application;
and the testing module is used for testing the page to be tested through the testing application.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may be operated in a hardware environment as shown in fig. 1, and may be implemented by software, or may be implemented by hardware, 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 starting method of 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 processors 501 (only one of which is shown), a memory 503, and a transmission means 505. as shown in fig. 5, the terminal may further include an input/output device 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 various functional applications and data processing by running the software programs and modules stored in the memory 503, that is, the method for starting a test page is implemented. The 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 through 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 means 505 is used for receiving or sending data via a network, and may also be used for data transmission between the processor and the memory. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 505 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices 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 for communicating with the internet in a wireless manner.
Among them, the memory 503 is used to store an application program in particular.
The processor 501 may call the application stored in the memory 503 through the transmission means 505 to perform the following steps:
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 parameter into the starting code to obtain a starting application;
and starting the page to be tested through the starting application.
By adopting the embodiment of the application, a scheme for testing the starting of the page is provided. The method comprises the steps of obtaining a target page parameter used for indicating a page path of a page to be tested, generating a starting application by using the target page parameter, wherein 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 one by one in the page testing process, but the page path of the page to be tested is directly found to open the page, and the page does not need to be manually started, so that the technical effect of improving the efficiency of starting the page to be tested in the page testing process is achieved, and the technical problem that the efficiency of starting the page to be tested in the page testing process is low in the related technology is solved.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 5 is only an illustration, and the terminal may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a Mobile Internet Device (MID), a PAD, etc. Fig. 5 is a diagram illustrating a 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 skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
Embodiments of the present application also provide a storage medium. Optionally, in this embodiment, the storage medium may be used to execute a program code of a test page starting method.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
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 parameter into the starting code to obtain a starting application;
and starting the page to be tested through the starting application.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including instructions for causing one or more computer devices (which may be personal computers, servers, network devices, or the like) to execute all or part of the steps of the method described in the embodiments of the present application.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in 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 illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
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 units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.