The content of the invention
It is an object of the invention to provide a kind of ARIXTRA UI automatic test side based on JmeterMethod and system, make user terminal support generate Jmeter scripts, make ARIXTRA UI automatic test withOther movements App tests realize that high-quality is connected.
Technical program of the present invention lies in providing a kind of ARIXTRA UI automatization survey based on JmeterMethod for testing, the method for testing includes:Step A, is recorded in mobile device App to controlOperating process, generates corresponding incoming event;Step B, based on the incoming event, is parsedAs a result;Step C, based on the analysis result, generates playback script;Step D, based on the playbackScript, generates Jmeter scripts.
Optionally, step A includes:The incoming event for generating is stored to input equipment and is referred toOrder caching.
Optionally, step C also includes, based on the analysis result, verifies the playback foot for generatingWhether this is correct.
Optionally, step D includes:Based on the playback script, by the OS of JmeterSampler, generates the Jmeter scripts.
The present invention also provides a kind of ARIXTRA UI automatization test system based on Jmeter, the peaceTall and erect automatization test system includes:Script record module, for being recorded in mobile device App inOperating process to control, generates corresponding incoming event;Parsing module, for defeated based on thisIncoming event, obtains analysis result.Playback script generation module, for being based on the analysis result,Generate playback script.Terminal module, based on the playback script, generates Jmeter scripts.
Optionally, the test system also includes:Input equipment instruction buffer, for by generateThe incoming event is stored into the input equipment instruction buffer.
Optionally, the terminal module also includes:Script authentication module, for returning that checking is generatedWhether correct put script.
Optionally, based on the playback script, by the OS Sampler of Jmeter, the Jmeter is generatedScript.
Automated testing method and system that the present invention is provided, by using the characteristic of Jmeter,So that ARIXTRA UI automatic test realizes that high-quality is connected with other movements App tests.
Specific embodiment
Purpose, technical scheme and advantage to make the embodiment of the present invention becomes more apparent, belowThe embodiment of the present invention is described in further details with reference to accompanying drawing.Here, the present invention's is schematicEmbodiment and its illustrate for explaining the present invention but not as a limitation of the invention.
Fig. 1 is the ARIXTRA UI automated testing method flow chart based on Jmeter of the present invention.As shown in Figure 1 automatic test step is as follows:
Step A, is recorded in mobile device App to the operating process of control, generates correspondingIncoming event;
Step B, based on the incoming event, obtains analysis result,
Step C, based on the analysis result, generates playback script;
Step D, based on the playback script, generates Jmeter scripts.
Optionally, step A includes:The incoming event for generating is stored to input equipment and is referred toOrder caching 205.
Optionally, step C also includes, based on the analysis result, verifies the playback foot for generatingThis.
Optionally, step D is specifically included:Based on the playback script, by Jmeter'sOS Sampler, generate the Jmeter scripts.
The present invention is specifically described with reference to a specific embodiment, but is worth noteMeaning is the specific embodiment merely to preferably describing the present invention, is not constituted to the present inventionImproper restriction.
Tester is connected Android device with computer, opens the App to be measured in Android device,Start the user terminal on computer.
Button is recorded by " beginning " clicked on user terminal, then in Android deviceApp to be measured is operated, and after the operation was ended, " termination " record is clicked on the subscriber terminalButton processed, user terminal can record the process that tester operates App in Android device, andGenerate corresponding shell playback scripts.Now just complete the process of the recording in automatic test.
After recording process is completed, tester passes through to click on the playback button on user terminal,User terminal will perform this shell playback script, and the Android device being connected with user terminalOn App will automatically perform operating process before tester, the purpose of the replayed sectionIt is whether the script that checking is generated is correct.
Then, tester clicks on the generation Jmeter script buttons on user terminal, user's endThe OS Sampler reference formats of matching jmeter are generated by obtaining the store path of shell scriptsXML texts, then by shell script store paths insert wherein, with this pass through shell feetXML texts are converted to the file that a suffix is " .jmx " for this, comprising generation in this documentOS Sampler content.Then, tester is run this " .jmx " with Jmeter instrumentsFile, can pass through Android device and perform the process that above-mentioned tester operates App automatically with this.
Tester can be automatic in ARIXTRA UI after with Jmeter TOs " .jmx " fileThat changes test adds in front and back others test scenes, such as first toward lane database before repetitive operationAdd and prepare data, or inquire about data base after the activation and see whether data are correctly inserted into.
Fig. 2 is the ARIXTRA UI automatization test system structure chart based on Jmeter of the present invention.As shown in Fig. 2 automatization test system includes:
Script records module 201, for being recorded in mobile device App in operation to controlJourney, generates corresponding incoming event;
Parsing module 202, for based on the incoming event, obtaining analysis result.
Playback script generation module 203, for based on the analysis result, generating playback script.
Terminal module 204, based on the playback script, generates Jmeter scripts.
Optionally, the test system also includes:Input equipment instruction buffer 205, for giving birth toInto the incoming event store into the input equipment instruction buffer 205.
Optionally, the terminal module 204 also includes:Script authentication module 206, for verifyingThe playback script of generation.
Optionally, based on the playback script, by the OS Sampler of Jmeter, the Jmeter is generatedScript.
The present invention is specifically described with reference to Fig. 3, however, it should be noted that this is concreteEmbodiment merely to preferably describe the present invention, do not constitute inappropriate limitation of the present invention.
What the present invention was provided is included based on the ARIXTRA UI automatization test system of Jmeter:TerminalModule 204, for playing back the UI interfaces in Android mobile phone in App various operations are carried out, and are propped upHold generation Jmeter scripts;Specifically, user can trigger recording by UI interfaces, terminateRecord, generate the functions such as Jmeter scripts, playback.
When starting to record, tester records button by " beginning " clicked on user terminal,Terminal module 204 starts to call script recording module 201 to be recorded, and now script records mouldThe various operating procedures that block 201 passes through recording user operation user terminal, generate corresponding code.Additionally, the present invention can also drive UI ARIXTRA automatization by adb shell send event.ToolBody ground, the module is parsed by using the adb orders getevent that Android system is carried/ dev/input/eventX files reading the user input event of Android operation system in real time, thenOriginal device directive is cached in input equipment instruction buffer 205, the input of user is storedEvent.Especially, because the incoming event has different results according to distinct device.For exampleFor ARIXTRA simulator, event0 is represented and is preserved screen incoming event and keypad input event, andIn some Android devices, same incoming event can be represented with event1.
When terminating to record, terminal module 204 is carried out by calling playback script generation module 203Script is played back, and then generates the playback script of shell-command row format.Wherein, playback script lifeIt is simple parsing and the output result that individual instructions are carried out according to parsing module 202 into module 203,The shell scripts of playback whole operation process are generated according to generating algorithm, is then verified by scriptWhether the script that the checking of module 206 is generated is correct, and parsing module 202 is to refer to input equipmentThese original device directives are resolved to order caching 205 user instruction of a rule, for example "X, y location carries out clicking operation " etc..Specifically, parsing module 202 is used to parse wall scrollDevice directive, its major function is as follows:Judge whether present instruction is the instruction for arranging X-coordinate;Judge whether present instruction is the instruction for arranging Y-coordinate;Judge whether present instruction is click on liftPlay instruction;Judge whether present instruction is click on by giving an order;Judge present instruction be whether byKey is pressed and given an order;Judge whether present instruction is that button lifts instruction;Whether judge present instructionIt is do-nothing instruction;Corresponding A SCII is converted to according to keyboard input devices instruction.
Finally, terminal module 204 is driven using the OS Sampler of Jmeter, is called backPut script (shell scripts) and generate " .jmx " script for being available for Jmeter to drive.Due to hereinImplementation is identical with preceding method, therefore detailed process will not be described here.
By the present invention provide automated testing method and system, tester can withAfter Jmeter TO .jmx before and after ARIXTRA UI automatic test add others checkout areasScape, such as first add toward lane database before repetitive operation and prepare data, or looks into after the activationAsk data base.Test script recording mode is more friendly for tester, and test threshold is low.Additionally, record script can be multiplexed to same model test machine.Jmeter scripts to tester compared withIt is familiar, test threshold is low.ARIXTRA UI automatic test can be integrated with other tests.For example check background data base after UI operations.By using the characteristic of Jmeter, so that ARIXTRAUI automatic tests realize that high-quality is connected with other movements App tests.
Particular embodiments described above, to the purpose of the present invention, technical scheme and beneficial effectFurther described, should be understood that and the foregoing is only the concrete of the present inventionEmbodiment, the protection domain being not intended to limit the present invention, it is all the present invention spirit andWithin principle, any modification, equivalent substitution and improvements done etc. should be included in the present inventionProtection domain within.