Supercharge Your Innovation With Domain-Expert AI Agents!

Method for testing JS code by using python, storage medium, device and system

A JS code and code technology, applied in the field of human-machine identification, can solve the problems of cumbersome process and inconvenient use, and achieve the effect of good test performance, wide application range and good portability

Active Publication Date: 2019-07-16
WUHAN DOUYU NETWORK TECH CO LTD
View PDF6 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005]However, since a large amount of JavaScript code is generated according to various conditions when generating JavaScript code, for example, when verifying whether the logged-in user name is correct, because the user name may It is all Chinese, all English, a combination of characters or other arbitrary methods, etc. Therefore, when testing, it is necessary to test various types of user names, that is, there are a large number of JavaScript codes for testing. If these large numbers of JavaScript codes are all placed in the browser to execute, the process is cumbersome, and it is very inconvenient to use

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for testing JS code by using python, storage medium, device and system
  • Method for testing JS code by using python, storage medium, device and system
  • Method for testing JS code by using python, storage medium, device and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0037] The present invention will be described in further detail below in conjunction with the accompanying drawings and embodiments.

[0038] see figure 1 As shown, the embodiment of the present invention provides a method of using python to test JS code, which is used to test whether the JS code is correct. In the embodiment of the present invention, the JS code to be detected is automatically generated JavaScript code, so that The KEY value of the room is used as an example to implement the addition function.

[0039] The JavaScript code for room number 0 is as follows:

[0040] function RoomEncrypt(nRoomId)

[0041] {

[0042] return nRoomId+0x457892ac;

[0043]}

[0044] The code for room number 1 is as follows:

[0045] function RoomEncrypt(nRoomId)

[0046] {

[0047] return nRoomId+0x8cbd92ac;

[0048]}

[0049] The above automatically generated JavaScript code is an encrypted data calculated according to the room number. For different room numbers, since the ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method for testing a JS code by using python, which relates to the technical field of man-machine identification and comprises the following steps of compiling the python code, and calling and executing the JS code in the python code to obtain an execution result of the JS code; adding a functional function with the same function as the JS code in the DLL file, and calling the functional function in the python code to obtain an execution result of the functional function; and comparing whether the execution result of the JS code is consistent with the execution resultof the function or not, and judging whether the JS code is correct or not according to the comparison result. The method for testing the JS code by using python provided by the invention has the advantages of relatively higher test efficiency, good test performance, good portability, wider application range and more convenience and quickness in modification.

Description

technical field [0001] The invention relates to the technical field of man-machine identification, in particular to a method, a storage medium, a device and a system for testing JS codes using python. Background technique [0002] JS, short for JavaScript, is the most popular scripting language on the Internet, and it can run in all major browsers, such as Internet Explorer, Chrome, Mozilla Firefox, Netscape, and Opera. [0003] At present, the programming language of WEB programs is JavaScript, which is a dynamic scripting language. When it is released, it is equivalent to the release of source code, which makes it extremely easy to be cracked. For some core JavaScript codes, many developers will write code to generate JavaScript. code, which can be frequently replaced and enhanced its security. At the same time, in order to ensure the accuracy of the automatically generated JavaScript code, a method is needed to test the automatically generated JavaScript code to verify w...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F11/36
CPCG06F11/3684G06F11/3688
Inventor 周志刚陈少杰张文明
Owner WUHAN DOUYU NETWORK TECH CO LTD
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More