CN111147329A - Method and system for testing mobile item by front-end real machine - Google Patents

Method and system for testing mobile item by front-end real machine Download PDF

Info

Publication number
CN111147329A
CN111147329A CN201911382654.4A CN201911382654A CN111147329A CN 111147329 A CN111147329 A CN 111147329A CN 201911382654 A CN201911382654 A CN 201911382654A CN 111147329 A CN111147329 A CN 111147329A
Authority
CN
China
Prior art keywords
mobile
file
module
item
node 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
CN201911382654.4A
Other languages
Chinese (zh)
Inventor
谭宇森
史伟
闵宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Eflycloud Computing Co Ltd
Original Assignee
Guangdong Eflycloud Computing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Eflycloud Computing Co Ltd filed Critical Guangdong Eflycloud Computing Co Ltd
Priority to CN201911382654.4A priority Critical patent/CN111147329A/en
Publication of CN111147329A publication Critical patent/CN111147329A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/12Network monitoring probes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Abstract

The invention discloses a method and a system for testing a mobile project by a front-end real machine, wherein the method comprises the following steps: creating a node file and configuring a local server: creating an fs module and an http module; adding a file path of the mobile item into the node file, and reading a page file of the mobile item by the fs module through the file path of the mobile item; running the node file and reading all texts in the node file; the http module generates a port number, and monitors all texts in the node file through the port number; the mobile terminal accesses and analyzes all texts in the node file through the IP address and the port number; the mobile terminal starts to test the mobile item, and if a problem is found in the test process, the corresponding problem is modified; if no problem is found in the test process, the test is ended, and the self-test is successful. According to the invention, before the mobile project is released, the mobile project is operated on the real machine for self-testing, so that the existing problems can be found in time and corrected in time, and the self-testing process is simpler.

Description

Method and system for testing mobile item by front-end real machine
Technical Field
The invention relates to the technical field of mobile web projects, in particular to a method and a system for testing a mobile project by a front-end real machine.
Background
Currently, with the continuous development of mobile networks, the practical use of mobile items, including mobile app items and mobile web items, is becoming very common. In practical applications, not every network mobile product will have its own mobile app item, but basically has its own mobile web item. In daily life, the degree of dependence of modern people on mobile phones is continuously strengthened, people often forward some information in instant messaging chats, and the information is a mobile web project.
Before the mobile web project product is launched, it needs to be self-tested by an in-house developer. The mobile web project self-testing has the same reason as the pc project self-testing, the pc project self-testing mainly runs on a computer, the mobile web project self-testing needs to be carried out on a mobile terminal, but the mobile web project needs to be released to a server to be accessed, so that when the mobile web project is tested, a simpler real-machine testing method is needed.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a method and a system for testing a mobile item by a front-end real machine.
In order to solve the technical problems, the invention provides the following technical scheme: a method for testing a mobile item by a front-end real machine comprises the following steps:
s1, creating a node file, and configuring a local server: creating an fs module and an http module;
s2, adding the file path of the mobile item into the node file, and reading the page file of the mobile item by the fs module through the file path of the mobile item;
s3, operating the node file, and reading all texts in the node file;
s4, generating a port number by the http module, and monitoring all texts in the node file through the port number;
s5, the mobile terminal is wirelessly connected with the local server and searches for the IP address of the mobile terminal; the mobile terminal accesses and analyzes all texts in the node file through the IP address and the port number;
s6, the mobile terminal starts to test the mobile item, and if a problem is found in the test process, the corresponding problem is modified; if no problem is found in the test process, the test is ended, and the self-test is successful.
Further, the step S2 further includes: and creating and packaging the mobile item, acquiring a file path of the packaged mobile item, and recording the file path.
Further, in the step S6, the mobile item after the modification is required to be repackaged, and the process returns to the step S2.
The invention also aims to provide a system for testing mobile projects by a front-end real machine, which comprises a node file creating module, a local server, a mobile project creating module, a node file operating module and a mobile terminal; the local server comprises an fs module and an http module;
the node file creating module is used for creating a node file;
the mobile project creating module is used for creating a mobile project, packaging the mobile project, acquiring a file path of the mobile project, recording the file path, and finally adding the mobile project into a node file;
the fs module is used for reading a page file of the mobile item through a file path of the mobile item;
the node file operation module is used for operating the node file and reading all texts in the node file;
the http module is used for generating a port number and monitoring all texts in the node file through the port number;
the mobile terminal is wirelessly connected with the local server and searches an IP address of the mobile terminal; the mobile terminal is also used for accessing and analyzing all texts in the node file through the IP address and the port number, and testing the mobile item; in addition, when the mobile terminal tests that the mobile item has a problem, the mobile item with the problem needs to be modified, and the mobile item is repackaged and then sent to the mobile item creation module.
After the technical scheme is adopted, the invention at least has the following beneficial effects: the invention can carry out self-test and self-repair on the mobile item, and is quick and convenient; in addition, the invention puts all items into the node file, wherein, as many items are provided, as many ports are correspondingly opened, each port can only correspond to one item file path, and when a certain mobile item needs to be accessed, the corresponding port can be directly accessed, so that the access process is simpler and faster.
Drawings
FIG. 1 is a flow chart of a method for testing a mobile project with a front-end live machine according to the present invention;
FIG. 2 is a system diagram of a front-end real machine testing mobile project according to the present invention.
Detailed Description
It should be noted that, in the present application, the embodiments and features of the embodiments may be combined with each other without conflict, and the present application is further described in detail with reference to the drawings and specific embodiments.
Example 1
The embodiment provides a method for testing a mobile project by a front-end real machine, and the main concept (thought) of the method comprises the following points:
1. generating a js file, adding corresponding modules which are respectively fs modules: mainly used for reading the corresponding file; an http module: the local server can be opened and a corresponding port number can be established;
2. finding a path for reading a file, reading and opening a page file which is required to be seen through an fs module;
3. after reading the file, resource files such as css, js and the like in the file also need to be read together and converted into a format which can be read and opened by node.js, so that the resource of the file can be accessed by the outer layer;
4. a port is generated through an http module to monitor and open a read file;
5. and then finding out the corresponding ip address by connecting an intranet or wifi started by a computer for reading files, and accessing the ip address and the generated port number.
According to the above concept, the present embodiment provides a method for testing a mobile item by a front-end real machine, as shown in fig. 1, the method includes the steps of:
s11, creating a node file, and configuring a local server: creating an fs module and an http module;
s12, adding a file path of the mobile item (or the mobile web item) into the node file, and reading the page file of the mobile item by the fs module through the file path of the mobile item; before that, mobile items need to be created in advance and packaged, file paths of the packaged mobile items are obtained, and the file paths are recorded; generally, the packaged mobile item includes an index file and an html file, and the file path of the files is recorded;
s13, operating the node file, and reading all texts in the node file;
s14, generating a port number by the http module, and monitoring all texts in the node file through the port number;
s15, the mobile terminal is wirelessly connected with the local server and searches for the IP address of the mobile terminal; the mobile terminal accesses and analyzes all texts in the node file through the IP address and the port number;
s16, the mobile terminal starts to test the mobile item, if a problem is found in the test process, the corresponding problem is modified, the mobile item with the modified problem needs to be repackaged, and the step S12 is returned; if no problem is found in the test process, the test is ended, and the self-test is successful.
Example 2
The embodiment provides a system for testing a mobile project by a front-end real machine on the basis of the method of the embodiment 1, and as shown in fig. 2, the system comprises a node file creating module, a local server, a mobile project creating module, a node file running module and a mobile terminal; the local server comprises an fs module and an http module;
the node file creating module is used for creating a node file;
the mobile project creating module is used for creating a mobile project, packaging the mobile project, acquiring a file path of the mobile project, recording the file path, and finally adding the mobile project into a node file;
the fs module is used for reading a page file of the mobile item through a file path of the mobile item;
the node file operation module is used for operating the node file and reading all texts in the node file;
the http module is used for generating a port number and monitoring all texts in the node file through the port number;
the mobile terminal is wirelessly connected with the local server and searches an IP address of the mobile terminal; the mobile terminal is also used for accessing and analyzing all texts in the node file through the IP address and the port number, and testing the mobile item; in addition, when the mobile terminal tests that the mobile item has a problem, the mobile item with the problem needs to be modified, and the mobile item is repackaged and then sent to the mobile item creation module.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various equivalent changes, modifications, substitutions and alterations can be made herein without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims (4)

1. A method for testing mobile items by a front-end real machine is characterized by comprising the following steps:
s1, creating a node file, and configuring a local server: creating an fs module and an http module;
s2, adding the file path of the mobile item into the node file, and reading the page file of the mobile item by the fs module through the file path of the mobile item;
s3, operating the node file, and reading all texts in the node file;
s4, generating a port number by the http module, and monitoring all texts in the node file through the port number;
s5, the mobile terminal is wirelessly connected with the local server and searches for the IP address of the mobile terminal; the mobile terminal accesses and analyzes all texts in the node file through the IP address and the port number;
s6, the mobile terminal starts to test the mobile item, and if a problem is found in the test process, the corresponding problem is modified; if no problem is found in the test process, the test is ended, and the self-test is successful.
2. The method for testing mobile items with front-end real machine as claimed in claim 1, wherein said step S2 further comprises: and creating and packaging the mobile item, acquiring a file path of the packaged mobile item, and recording the file path.
3. The method of claim 1, wherein in step S6, the mobile item after modification needs to be repackaged, and the method returns to step S2.
4. The system for testing the mobile project by the front-end real machine as claimed in claim 1, characterized by comprising a node file creation module, a local server, a mobile project creation module, a node file operation module and a mobile terminal; the local server comprises an fs module and an http module;
the node file creating module is used for creating a node file;
the mobile project creating module is used for creating a mobile project, packaging the mobile project, acquiring a file path of the mobile project, recording the file path, and finally adding the mobile project into a node file;
the fs module is used for reading a page file of the mobile item through a file path of the mobile item;
the node file operation module is used for operating the node file and reading all texts in the node file;
the http module is used for generating a port number and monitoring all texts in the node file through the port number;
the mobile terminal is wirelessly connected with the local server and searches an IP address of the mobile terminal; the mobile terminal is also used for accessing and analyzing all texts in the node file through the IP address and the port number, and testing the mobile item; in addition, when the mobile terminal tests that the mobile item has a problem, the mobile item with the problem needs to be modified, and the mobile item is repackaged and then sent to the mobile item creation module.
CN201911382654.4A 2019-12-27 2019-12-27 Method and system for testing mobile item by front-end real machine Pending CN111147329A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911382654.4A CN111147329A (en) 2019-12-27 2019-12-27 Method and system for testing mobile item by front-end real machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911382654.4A CN111147329A (en) 2019-12-27 2019-12-27 Method and system for testing mobile item by front-end real machine

Publications (1)

Publication Number Publication Date
CN111147329A true CN111147329A (en) 2020-05-12

Family

ID=70521308

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911382654.4A Pending CN111147329A (en) 2019-12-27 2019-12-27 Method and system for testing mobile item by front-end real machine

Country Status (1)

Country Link
CN (1) CN111147329A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013148265A2 (en) * 2012-03-29 2013-10-03 Antenna Software, Inc. Method and system for testing of mobile web sites
CN104991860A (en) * 2015-06-24 2015-10-21 深圳欧德蒙科技有限公司 WEB front-end automated development method and system
CN106598575A (en) * 2016-11-30 2017-04-26 武汉斗鱼网络科技有限公司 Front-end data simulation implementation method and system
CN108345531A (en) * 2017-01-23 2018-07-31 阿里巴巴集团控股有限公司 A kind of test method, apparatus and system
CN108427638A (en) * 2018-01-19 2018-08-21 口碑(上海)信息技术有限公司 Region network of relation marketing activity test method and device
CN110493318A (en) * 2019-07-23 2019-11-22 北京字节跳动网络技术有限公司 Processing method, device, medium and the equipment of HTTP request information

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013148265A2 (en) * 2012-03-29 2013-10-03 Antenna Software, Inc. Method and system for testing of mobile web sites
CN104991860A (en) * 2015-06-24 2015-10-21 深圳欧德蒙科技有限公司 WEB front-end automated development method and system
CN106598575A (en) * 2016-11-30 2017-04-26 武汉斗鱼网络科技有限公司 Front-end data simulation implementation method and system
CN108345531A (en) * 2017-01-23 2018-07-31 阿里巴巴集团控股有限公司 A kind of test method, apparatus and system
CN108427638A (en) * 2018-01-19 2018-08-21 口碑(上海)信息技术有限公司 Region network of relation marketing activity test method and device
CN110493318A (en) * 2019-07-23 2019-11-22 北京字节跳动网络技术有限公司 Processing method, device, medium and the equipment of HTTP request information

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
ERIC BIN: "Node.js 移动端可访问的静态服务器", 《HTTPS://SEGMENTFAULT.COM/A/1190000005927871》 *
小火柴的蓝色理想: "移动web开发之移动端真机测试", 《HTTPS://WWW.CNBLOGS.COM/XIAOHUOCHAI/P/5512051.HTML》 *
李帅醒: "使用nodejs搭建本地http服务器——李帅醒博客", 《HTTPS://BLOG.CSDN.NET/WCSLB/ARTICLE/DETAILS/53414376》 *

Similar Documents

Publication Publication Date Title
CN111010316B (en) Flow playback method, device and system
CN108964968B (en) Service access management method and system in container cloud environment
CN109800258B (en) Data file deployment method, device, computer equipment and storage medium
US9892258B2 (en) Automatic synthesis of unit tests for security testing
CN110532169A (en) Interface testing case generation method, device, computer equipment and storage medium
US20100017427A1 (en) Multilevel Hierarchical Associations Between Entities in a Knowledge System
US9417991B2 (en) Translation verification testing
CN108459850B (en) Method, device and system for generating test script
US10803166B1 (en) Automated determination of application privileges
CN105975352A (en) Cache data processing method and server
CN105160018A (en) Method, device and system for image copy/paste
CN112202862B (en) Method and device for synchronizing cluster data and files based on kafka
CN112860507B (en) Control method and device for sampling rate of distributed link tracking system
US11635972B2 (en) Multi-tenant java agent instrumentation system
CN113448690A (en) Monitoring method and device
CN111147329A (en) Method and system for testing mobile item by front-end real machine
US20230006898A1 (en) A Method of Capturing Packets from a Container in a Cluster
CN108287876A (en) Support the power quality data service quality detection method and device of multiple format
CN107276998A (en) A kind of performance optimization method and device based on OpenSSL
US20230118838A1 (en) Advanced agent instrumentation for opentelemetry implementations
CN112527453B (en) Virtualization information simulation system, method and computer-readable storage medium
US11533279B2 (en) Method for electronic messaging using image based noisy content
CN115237889A (en) Database switching method and device, storage medium and computer equipment
CN112631894A (en) Code detection method, device, storage medium and computer equipment
CN112463596A (en) Test case data processing method, device and equipment and processing equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200512

RJ01 Rejection of invention patent application after publication