[go: up one dir, main page]

CN105528297A - Method and device for testing web page - Google Patents

Method and device for testing web page Download PDF

Info

Publication number
CN105528297A
CN105528297A CN201610066753.1A CN201610066753A CN105528297A CN 105528297 A CN105528297 A CN 105528297A CN 201610066753 A CN201610066753 A CN 201610066753A CN 105528297 A CN105528297 A CN 105528297A
Authority
CN
China
Prior art keywords
test
tested
test case
web page
report
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
CN201610066753.1A
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.)
Guangzhou Kugou Computer Technology Co Ltd
Original Assignee
Guangzhou Kugou Computer Technology 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 Guangzhou Kugou Computer Technology Co Ltd filed Critical Guangzhou Kugou Computer Technology Co Ltd
Priority to CN201610066753.1A priority Critical patent/CN105528297A/en
Publication of CN105528297A publication Critical patent/CN105528297A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to a method and a device for testing a web page and belongs to the technical field of computers. The method comprises steps as follows: a test case object of the web page is generated according to the at least one test case, to-be-tested elements in the web page are tested through test cases in the test case object sequentially, a test result is obtained and is verified, a verification result is obtained and used for indicating whether the test result is correct or not, and a test report is generated according to the verification result and transmitted to a designated address. The overall test process for test case organization, test case execution, result analysis and report transmission is executed automatically, the problem of low automated test degree in the prior art is solved, the test efficiency is improved, and the web application and test development period is shortened.

Description

The method that web page is tested and device
Technical field
The present invention relates to field of computer technology, particularly a kind of method that web page is tested and device.
Background technology
Fast universal along with web application, the iteration cycle that web application is issued is also shorter and shorter, and for web application developer, carrying out high iteration tests to web product is fast and effectively an important challenge.
For the web application that high iteration, cycle are short, usually can introduce web automatic test to replace and repeat loaded down with trivial details manual testing's operation.For the automated testing method of web application in prior art, usually automatic business processing is carried out to the implementation of test case, namely automatically perform the operation that test case is corresponding, thus simplify the manual steps of developer.
Realizing in process of the present invention, inventor finds prior art, and there are the following problems:
Automated testing method for web application of the prior art only carries out automatic business processing to the implementation of test case, and some other step in test process, the selection of such as test case, the element to be tested step such as location and test result analysis in web page is all manually completed by developer, automaticity is lower, affects testing efficiency.
Summary of the invention
Embodiments provide a kind of method of testing web page and device, technical scheme is as follows:
According to the first aspect of the embodiment of the present invention, provide a kind of method that web page is tested, comprising:
According to the test case object of at least one Test cases technology web page;
By each test case in this test case object, the element to be tested in this web page is tested successively, obtain test result;
Verify this test result, obtain check results, whether this check results is used to indicate this test result correct;
Test report is generated according to this check results;
This test report is sent to assigned address.
Optionally, this leads to is tested the element to be tested in this web page by each test case in this test case object successively, obtains test result, comprising:
When performing a test case in this test case object, locate the position of element to be tested in this web page that this test case is corresponding;
Test operation corresponding to this test case is performed in the position of this element to be tested;
Obtain the test result that this test operation is corresponding.
Optionally, this is tested the element to be tested in this web page by each test case in this test case object successively, obtains test result, comprising:
From the configured list pre-set, obtain the test node address that each test environment is corresponding, this test environment is used to indicate the operating system and browser of running this web page;
When performing a test case in this test case object, the test node address corresponding according to this each test environment performs request to the test node transmission that this each test environment is corresponding, comprise the position of element to be tested corresponding to this test case in this web page and test operation in this execution request, this execution request is used to indicate this test node and performs this test operation in the position of this element to be tested;
Receive the test result that test node corresponding to this each test environment returns.
Optionally, this, according to the test case object of at least one Test cases technology web page, comprising:
Obtain initial path;
The test case file of default naming rule is met under searching for this initial path;
The test case file meeting this default naming rule is added to this use-case object by the mode of searching loop.
Optionally, this test report is sent to assigned address by this, comprising:
By lettergram mode, this test report is sent to the addresses of items of mail of specifying.
According to the second aspect of the embodiment of the present invention, provide a kind of device tested web page, this device comprises:
Object generation module, for the test case object according at least one Test cases technology web page;
Test module, for being tested the element to be tested in this web page by each test case in this test case object successively, obtains test result;
Correction verification module, for verifying this test result, obtain check results, whether this check results is used to indicate this test result correct;
Report generation module, for generating test report according to this check results;
Report sending module, for being sent to assigned address by this test report.
Optionally, this test module, comprising:
Positioning unit, for when performing a test case in this test case object, locates the position of element to be tested in this web page that this test case is corresponding;
Test cell, for performing test operation corresponding to this test case in the position of this element to be tested;
Result acquiring unit, for obtaining test result corresponding to this test operation.
Optionally, this test module, comprising:
Address acquisition unit, for obtaining test node address corresponding to each test environment from the configured list pre-set, this test environment is used to indicate the operating system and browser of running this web page;
Request transmitting unit, for when performing a test case in this test case object, the test node address corresponding according to this each test environment performs request to the test node transmission that this each test environment is corresponding, comprise the position of element to be tested corresponding to this test case in this web page and test operation in this execution request, this execution request is used to indicate this test node and performs this test operation in the position of this element to be tested;
Result receiving element, for receiving the test result that test node corresponding to this each test environment returns.
Optionally, this object generation module, comprising:
Path acquiring unit, for obtaining initial path;
File search unit, for meeting the test case file of default naming rule under searching for this initial path;
Adding device, adds the test case file meeting this default naming rule to this use-case object for the mode by searching loop.
Optionally, this report sending module, for being sent to the addresses of items of mail of specifying by this test report by lettergram mode.
The technical scheme that the embodiment of the present invention provides can comprise following beneficial effect:
By the test case object according at least one Test cases technology web page, by each test case in this test case object, the element to be tested in this web page is tested successively, obtain test result, this test result is verified, obtain check results, whether this check results is used to indicate this test result correct, test report is generated according to this check results, this test report is sent to assigned address, automatically perform the test case tissue in test process, test case performs, the overall process that interpretation of result and report send, solve the problem that prior art automatic test degree is lower, reach raising testing efficiency, shorten web application and the effect in test development cycle.
Should be understood that, it is only exemplary and explanatory that above general description and details hereinafter describe, and can not limit the present invention.
Accompanying drawing explanation
Accompanying drawing to be herein merged in instructions and to form the part of this instructions, shows embodiment according to the invention, and is used from instructions one and explains principle of the present invention.
Fig. 1 is a kind of process flow diagram to the method that web page is tested according to an exemplary embodiment;
Fig. 2 is a kind of process flow diagram to the method that web page is tested according to another exemplary embodiment;
Fig. 3 is a kind of block diagram to the device that web page is tested according to an exemplary embodiment;
Fig. 4 is a kind of block diagram to the device that web page is tested according to another exemplary embodiment;
Fig. 5 is the block diagram of a kind of equipment according to an exemplary embodiment;
Fig. 6 is the block diagram of a kind of equipment according to an exemplary embodiment.
Embodiment
Here will be described exemplary embodiment in detail, its sample table shows in the accompanying drawings.When description below relates to accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawing represents same or analogous key element.Embodiment described in following exemplary embodiment does not represent all embodiments consistent with the present invention.On the contrary, they only with as in appended claims describe in detail, the example of apparatus and method that aspects more of the present invention are consistent.
The method that the embodiment of the present invention provides, can be applicable in the electronic equipment of installation and operation application program.Such as, electronic equipment includes but not limited to the electronic equipment such as PC (PersonalComputer, personal computer), mobile phone, panel computer, kneetop computer.Wherein, application program can be weblication, and this weblication in the operating systems such as window system, Mac system, Unix system or linux system, can run based on browser program mounted in operating system.
Fig. 1 is a kind of process flow diagram to the method that web page is tested according to an exemplary embodiment, the method may be used in electronic equipment, this electronic equipment can be PC, mobile phone, panel computer, kneetop computer or server etc., as shown in Figure 1, the method can comprise following several step:
In a step 101, according to the test case object of at least one Test cases technology web page.
In a step 102, by each test case in this test case object, the element to be tested in this web page is tested successively, obtain test result.
In step 103, verify this test result, obtain check results, whether this check results is used to indicate this test result correct.
At step 104, test report is generated according to this check results.
In step 105, this test report is sent to assigned address.
In sum, the method that web page is tested shown in the embodiment of the present invention, by the test case object according at least one Test cases technology web page, by each test case in this test case object, the element to be tested in this web page is tested successively, obtain test result, this test result is verified, obtain check results, whether this check results is used to indicate this test result correct, test report is generated according to this check results, this test report is sent to assigned address, automatically perform the test case tissue in test process, test case performs, the overall process that interpretation of result and report send, solve the problem that prior art automatic test degree is lower, reach raising testing efficiency, shorten web application and the effect in test development cycle.
Fig. 2 is a kind of process flow diagram to the method that web page is tested according to another exemplary embodiment, the method may be used in electronic equipment, this electronic equipment can be PC, mobile phone, panel computer, kneetop computer or server etc., as shown in Figure 2, the method can comprise following several step:
In step 201, obtain initial path, under searching for this initial path, meet the test case file of default naming rule, add the test case file meeting this default naming rule to this use-case object by the mode of searching loop.
Multiple element to be tested may be comprised in a web page, such as input frame or can the control etc. of clicking operation, each test elements may have multiple test case, all test cases of each element to be tested in a web page can be organized, so that follow-up test automatically performs successively by the method shown in the embodiment of the present invention.
In the embodiment of the present invention, with under windows environment, be example based on Python, carry out unified management test case by the discover module of unittest, its code can be as follows:
First above-mentioned code defines initial path, then by all test case files met under pattern naming rule under the initial path of discover method search appointment, find rear test case file, by the method for searching loop, all legal test case files are joined in test case object, finally return test case object, and performed all use-cases under the test case object returned by runner.run method.
In step 202., when performing a test case in this test case object, the position of element to be tested in this web page that this test case is corresponding is located.
In execution test case, when testing with the element to be tested corresponding to this test case, first-selection needs to locate this position of element to be tested in web page, then just can at associative operation corresponding to corresponding position implementation of test cases.
Such as, before element location, can first introduce webdriver module, wherein following By, ActionChains are mainly used in some special locator meamss or right mouse button operation scenario, and its required some modules introduced can be as follows:
fromseleniumimportwebdriver
fromselenium.webdriver.common.byimportBy
fromselenium.webdriver.common.action_chainsimportActionChains
When locating, which web page can be defined open under browser, namely script is indicated when automatically performing, with which browser execution web page, as IE, Firefox, Chrome, and return corresponding driver object, wherein, base_url is tested page address, and following webdriver.Firefox () shows that definition one opens tested object at red fox browser, namely, when automatic test, red fox browser execution application program is used.
driver=webdriver.Firefox()
driver.get(base_url)
In step 203, perform test operation corresponding to this test case in the position of this element to be tested, obtain the test result that this test operation is corresponding.
The embodiment of the present invention is described element location for webdriver module:
Example 1:
driver.find_element_by_id("AccountKugouID").send_keys("1234567")
Driver.find_element_by_id (" RealName ") .send_keys (u " Zhang San ")
printdriver.find_element_by_id("AccountKugouID").get_attribute("value")
printdriver.find_element_by_id("RealName").get_attribute("value")
As in above-mentioned four lines code, front two row navigate to by find_element_by_id method two text edit box control element that id is called AccountKugouID and RealName, and automatically ' 1234567 ' and ' Zhang San ' content is sent in edit box, and then obtain the actual value got in AccountKugouID and RealName two elements by get_attribute method, and printout.
Example 2:
selectid=driver.find_element_by_xpath("//*[id='askQuestion']/ul/
li[2]/span[1]/input[1]")
selectid.click()
ActionChains(driver).move_to_element(selectid).perform()
In above-mentioned three line codes, 1st line code, locate by driver_find_elemment_by_xpath method the control element that xpath level is // * [id='askQuestion']/ul/li [2]/span [1]/input [1], in the page of reality, this element is a drop-down list.In 2nd line code, click this drop-down list by click method.In 3rd line code, by move__to_element method by mouse-over on drop-down list.
In step 204, obtain the test node address that each test environment is corresponding from the configured list pre-set, this test environment is used to indicate the operating system and browser of running this web page.
In step 205, to send to the test node that this each test environment is corresponding according to test node address corresponding to this each test environment and perform request, in this execution request, comprise the position of element to be tested corresponding to this test case in this web page and test operation.
Wherein, this execution request is used to indicate this test node and performs this test operation in the position of this element to be tested.
In step 206, the test result that test node corresponding to this each test environment returns is received.
Test process due to a web page needs to carry out in different test environments respectively usually, in order to reduce the test job amount of developer, test case can also distribute execution by the embodiment of the present invention automatically in multiple different test environment, performs under namely test code being operated in different computers, different browsers simultaneously.As certain test case requires as done function compatibility test under IE, Firefox, Chrome under different operating system is as windowxp, window7, windows8 and different browsers, now allow test case perform under various circumstances by distributed mechanism simultaneously.
In embodiments of the present invention, distributed testing can realize with several agent node services by creating a host node service, usually host node service is disposed in the test terminal performing test script, the terminal disposition agent node service that other test environment is corresponding, when the test script of host node performs, by having transmit a request to host node service, host node resolves the request sended over, then served by host node in the terminal being forwarded to again and disposing agent node service and perform, thus the request communication realized between host node and agent node, so just realize that test code is concurrent to be performed on multiple test environment simultaneously, automatically compatibility test is carried out under realizing varying environment with this.
Such as, under windows environment, be example based on Python, can be as follows with concrete distributed implementation step:
Introduce module needed for seleniumgrid2;
fromselenium.webdriverimportRemote
Wherein, Remote can send instructions to far-end and control browser.
Create a host node hub node and several agent nodes Node node, wherein hub host node is mainly used for the registration and the status information that manage each agent node, and accept the request call of Terminal Server Client code, and then the transferring order of request is performed to agent node.
Create hub host node method:
java-jarselenium-server-standalone-x.xx.x.jar-rolehub-port4444
Create node agent node method:
java-jarselenium-server-standalone-x.xx.x.jar-rolenode-port5555
java-jarselenium-server-standalone-x.xx.x.jar-rolenode-port5556
java-jarselenium-server-standalone-x.xx.x.jar-rolenode-port5557
The foundation step of the host node that above-mentioned code is shown and agent node can directly run under command prompt, wherein selenium-server-standalone-x.xx.x.jar can obtain on the official website of correspondence, and port port below not exclusive, as long as when port value is unoccupied, all can specify.
It should be noted that, before distributed use-case performs, need first on the agent node of correspondence, to run corresponding node serve.
When multinode is tested, first define a list, to store the configuration information under varying environment, as address, port, browser etc., define three node address informations as following, when namely showing to run use-case, in following three varying environments, under different browsers, use-case can be run.
lists={'http://127.0.0.1:5555/wd/hub':'chrome',
'http://192.168.9.131:5556/wd/hub':”firefox”,
'http://192.168.9.201:5557/wd/hub':'internetexplorer'}
When far call, browserName and host information can obtain from the environment configurations list of definition, makes code can perform use-case under different host main frames and browerName browser.
Its code can be as follows:
Test case, when performing, can operate in the IE browser of the chrome browser of the machine (127.0.0.1), the Firefox browser of (192.168.9.131) and (192.168.9.201) by above-mentioned code simultaneously.
In step 207, verify this test result, obtain check results, whether this check results is used to indicate this test result correct.
Concrete, in the embodiment of the present invention, with under windows environment, being example based on Python, when verifying test result, unittest unit testing framework can being introduced:
importunittest
Define a test class and inherit unittest.TestCase, and in this type of, use-case initialization and cleaning work being placed in setUp () and tearDown () method.
In test class, define each method of test example, during method of test example defining named, start with test.
deftest_login_accountName(self):
" " " logs in the display of account number name to check " " "
self.driver.get(self.base_url+"/")
setWindow.setWindowSize(self.driver,"defalut",'1300','900')
login.login_ByCookie(self.driver,self.base_url)
time.sleep(2)
self.assertEqual(self.driver.find_element_by_xpath("//span[class='uName']").text,'mikezhou')
In above-mentioned use-case, xpath node in tested program is found to be the element of/span [class='uName'] by the method using find_element_by_xpath to search object, and then the text attribute of this element is obtained by text method, compare finally by by the character string of the text attribute and expected results that get nominative testing element, method is asserted by calling assertEqual, the text in the element got more at last is equal with mikezhou, if unequal, then test case performs failure, otherwise, test case is passed through.Wherein, with assertEqual, the embodiment of the present invention only asserts that method is carried out being verified as example and is described, in practical application, also can according to the type of element to be tested use in unittest other assert method, as assertTrue, assertNotEqual, assertIsInstance, assertIn etc.
In a step 208, test report is generated according to this check results.
The embodiment of the present invention introduces test report module, and defines Html reporting format, and content is as follows:
importHTMLTestRunner
Its test report generating code can be as follows:
Above-mentioned code first defines a report file and is used for depositing test report, and define related content and the Naming conventions of test report, as defined test report naming rule, by present system time generate and suffix is the relevant information such as test title and test description in result.html, test report.When implementation of test cases, the runner object generated by HTMLTestRunner performs use-case runner.run (testunit), after executing, can generate corresponding test report file.
In step 209, by lettergram mode, this test report is sent to the addresses of items of mail of specifying.
The embodiment of the present invention introduces associated mail module:
importsmtplib
fromemail.mime.textimportMIMEText
And definition sends email solution:
defsend_Mail(file_new):
mail_from='xxxxxxxxxxxxx'
main_to='xxxxxxxxxxxxx'
username='xxxxxxxxxxxxx'
password="xxxxxxxxx"
smtpServer="smtp.bbb.com"
pfile=open(file_new,'rb')
mail_body=pfile.read()
pfile.close()
msg=MIMEText(mail_body,_subtype='html',_charset='utf-8')
Msg [' Subject'] report of=u' automatic test '
msg['data']=time.strftime('%a,%d%b%Y%H:%M:%S%z')
smtp=smtplib.SMTP()
smtp.connect(smtpServer)
smtp.login(username,password)
smtp.sendmail(mail_from,main_to,msg.as_string())
smtp.quit()
print"sendmailcomplete!"
Send report, under searching test report catalogue, find up-to-date test report file, and call mail sending function:
defsend_Report(testreport):
result_dir=testreport
list=os.listdir(result_dir)
list.sort(key=lambdafn:os.path.getmtine(result_dir+"\\"+fn))
Printu " up-to-date test report file: "+lists [-1]
file_new=os.path.join(result_dir,lists[-1])
printfile_new
send_Mail(file_new)
After test case executes, call send_Report method, carry out mail sending:
In above-mentioned principal function code segment, after runner.run (createsuite ()) execution use-case method completes, automatically can generate test report, now filter out up-to-date test report by send_Report () method, and send to related personnel.
In sum, the method that web page is tested shown in the embodiment of the present invention, by the test case object according at least one Test cases technology web page, by each test case in this test case object, the element to be tested in this web page is tested successively, obtain test result, this test result is verified, obtain check results, whether this check results is used to indicate this test result correct, test report is generated according to this check results, this test report is sent to assigned address, automatically perform the test case tissue in test process, test case performs, the overall process that interpretation of result and report send, solve the problem that prior art automatic test degree is lower, reach raising testing efficiency, shorten web application and the effect in test development cycle.
Fig. 3 is a kind of block diagram to the device that web page is tested provided according to an exemplary embodiment.Device can be applicable in above-mentioned electronic equipment, and as shown in Figure 3, this device can comprise:
Object generation module 301, for the test case object according at least one Test cases technology web page;
Test module 302, for being tested the element to be tested in described web page by each test case in described test case object successively, obtains test result;
Correction verification module 303, for verifying described test result, obtain check results, whether described check results is used to indicate described test result correct;
Report generation module 304, for generating test report according to described check results;
Report sending module 305, for being sent to assigned address by described test report.
In sum, the device that web page is tested that the present embodiment provides, by the test case object according at least one Test cases technology web page, by each test case in this test case object, the element to be tested in this web page is tested successively, obtain test result, this test result is verified, obtain check results, whether this check results is used to indicate this test result correct, test report is generated according to this check results, this test report is sent to assigned address, automatically perform the test case tissue in test process, test case performs, the overall process that interpretation of result and report send, solve the problem that prior art automatic test degree is lower, reach raising testing efficiency, shorten web application and the effect in test development cycle.
Fig. 4 is a kind of block diagram to the device that web page is tested provided according to another exemplary embodiment.Device can be applicable in above-mentioned electronic equipment, and as shown in Figure 4, this device can comprise:
Object generation module 401, for the test case object according at least one Test cases technology web page;
Test module 402, for being tested the element to be tested in described web page by each test case in described test case object successively, obtains test result;
Correction verification module 403, for verifying described test result, obtain check results, whether described check results is used to indicate described test result correct;
Report generation module 404, for generating test report according to described check results;
Report sending module 405, for being sent to assigned address by described test report.
Optionally, described test module 402, comprising:
Positioning unit 402a, for when performing a test case in described test case object, locates the position of element to be tested in described web page that described test case is corresponding;
Test cell 402b, for performing test operation corresponding to described test case in the position of described element to be tested;
Result acquiring unit 402c, for obtaining test result corresponding to described test operation.
Optionally, described test module 402, comprising:
Address acquisition unit 402d, for obtaining test node address corresponding to each test environment from the configured list pre-set, described test environment is used to indicate the operating system and browser of running described web page;
Request transmitting unit 402e, for when performing a test case in described test case object, the test node address corresponding according to each test environment described performs request to the test node transmission that each test environment described is corresponding, described execution in request comprises the position of element to be tested corresponding to described test case in described web page and test operation, and described execution request is used to indicate described test node and performs described test operation in the position of described element to be tested;
Result receiving element 402f, for receiving the test result that test node corresponding to each test environment described returns.
Optionally, described object generation module 401, comprising:
Path acquiring unit 401a, for obtaining initial path;
File search unit 401b, for meeting the test case file of default naming rule under searching for described initial path;
Adding device 401c, adds the test case file meeting described default naming rule to described use-case object for the mode by searching loop.
Optionally, described report sending module 405, for being sent to the addresses of items of mail of specifying by described test report by lettergram mode.
In sum, the device that web page is tested that the embodiment of the present invention provides, by the test case object according at least one Test cases technology web page, by each test case in this test case object, the element to be tested in this web page is tested successively, obtain test result, this test result is verified, obtain check results, whether this check results is used to indicate this test result correct, test report is generated according to this check results, this test report is sent to assigned address, automatically perform the test case tissue in test process, test case performs, the overall process that interpretation of result and report send, solve the problem that prior art automatic test degree is lower, reach raising testing efficiency, shorten web application and the effect in test development cycle.
Fig. 5 is the structural representation of the equipment 500 provided according to one embodiment of the invention.Such as, equipment 500 can be a PC or server.With reference to Fig. 5, equipment 500 comprises processing components 522, and it comprises one or more processor further, and the memory resource representated by storer 532, such as, for storing the instruction that can be performed by processing element 522, application program.The application program stored in storer 532 can comprise each module corresponding to one group of instruction one or more.In addition, processing components 522 is configured to perform instruction, to perform above-mentioned method of testing web page.
Equipment 500 can also comprise the power management that a power supply module 526 is configured to actuating equipment 500, and a wired or wireless network interface 550 is configured to equipment 500 to be connected to network, and input and output (I/O) interface 558.Equipment 500 can operate the operating system based on being stored in storer 532, such as WindowsServerTM, MacOSXTM, UnixTM, LinuxTM, FreeBSDTM or similar.
Please refer to Fig. 6, it illustrates the structural representation of the equipment 600 that one embodiment of the invention provides.This equipment 600 can be the electronic equipments such as mobile phone, panel computer, kneetop computer and wearable device.Specifically:
Equipment 600 can comprise RF circuit 610, includes the storer 620 of one or more computer-readable recording mediums, input block 630, display unit 640, sensor 650, voicefrequency circuit 660, WiFi (wirelessfidelity, Wireless Fidelity) module 670, include the parts such as processor 680 and power supply 690 that more than or processes core.It will be understood by those skilled in the art that the device structure shown in Fig. 6 does not form the restriction to equipment, the parts more more or less than diagram can be comprised, or combine some parts, or different parts are arranged.Wherein:
RF circuit 610 can be used for receiving and sending messages or in communication process, the reception of signal and transmission, especially, after being received by the downlink information of base station, transfer to more than one or one processor 680 to process; In addition, base station is sent to by relating to up data.Usual RF circuit includes but not limited to antenna, at least one amplifier, tuner, one or more oscillator, subscriber identity module (SIM) card, transceiver, coupling mechanism, LNA (LowNoiseAmplifier, low noise amplifier), diplexer etc.In addition, RF circuit can also by radio communication and network and other devices communicatings.Radio communication can use arbitrary communication standard or agreement, include but not limited to GSM (GlobalSystemofMobilecommunication, global system for mobile communications), GPRS (GeneralPacketRadioService, general packet radio service), CDMA (CodeDivisionMultipleAccess, CDMA), WCDMA (WidebandCodeDivisionMultipleAccess, Wideband Code Division Multiple Access (WCDMA)), LTE (LongTermEvolution, Long Term Evolution), Email, SMS (ShortMessagingService, Short Message Service) etc.
Storer 620 can be used for storing software program and module.Processor 680 is stored in software program and the module of storer 620 by running, thus performs the application of various function and data processing.Storer 620 mainly can comprise storage program district and store data field, and wherein, storage program district can store operating system, application program (such as sound-playing function, image player function etc.) etc. needed at least one function; Store data field and can store the data (such as voice data, phone directory etc.) etc. created according to the use of equipment 600.In addition, storer 620 can comprise high-speed random access memory, can also comprise nonvolatile memory, such as at least one disk memory, flush memory device or other volatile solid-state parts.Correspondingly, storer 620 can also comprise Memory Controller, to provide the access of processor 680 and input block 630 pairs of storeies 620.
Input block 630 can be used for the numeral or the character information that receive input, and produces and to arrange with user and function controls relevant keyboard, mouse, control lever, optics or trace ball signal and inputs.Particularly, input block 630 can comprise Touch sensitive surface 631 and other input equipments 632.Touch sensitive surface 631, also referred to as touch display screen or Trackpad, user can be collected or neighbouring touch operation (such as user uses any applicable object or the operations of annex on Touch sensitive surface 631 or near Touch sensitive surface 631 such as finger, stylus) thereon, and drive corresponding coupling arrangement according to the formula preset.Optionally, Touch sensitive surface 631 can comprise touch detecting apparatus and touch controller two parts.Wherein, touch detecting apparatus detects the touch orientation of user, and detects the signal that touch operation brings, and sends signal to touch controller; Touch controller receives touch information from touch detecting apparatus, and converts it to contact coordinate, then gives processor 680, and the order that energy receiving processor 680 is sent also is performed.In addition, the polytypes such as resistance-type, condenser type, infrared ray and surface acoustic wave can be adopted to realize Touch sensitive surface 631.Except Touch sensitive surface 631, input block 630 can also comprise other input equipments 632.Particularly, other input equipments 632 can include but not limited to one or more in physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, control lever etc.
Display unit 640 can be used for the various graphical user interface showing information or the information being supplied to user and the equipment 100 inputted by user, and these graphical user interface can be made up of figure, text, icon, video and its combination in any.Display unit 640 can comprise display panel 641, optionally, the form such as LCD (LiquidCrystalDisplay, liquid crystal display), OLED (OrganicLight-EmittingDiode, Organic Light Emitting Diode) can be adopted to configure display panel 641.Further, Touch sensitive surface 631 can cover on display panel 641, when Touch sensitive surface 631 detects thereon or after neighbouring touch operation, send processor 680 to determine the type of touch event, on display panel 641, provide corresponding vision to export with preprocessor 680 according to the type of touch event.Although in figure 6, Touch sensitive surface 631 and display panel 641 be as two independently parts realize input and input function, in certain embodiments, can by Touch sensitive surface 631 and display panel 641 integrated and realize input and output function.
Equipment 600 also can comprise at least one sensor 650, such as optical sensor, motion sensor and other sensors.Particularly, optical sensor can comprise ambient light sensor and proximity transducer, and wherein, ambient light sensor the light and shade of environmentally light can regulate the brightness of display panel 641, proximity transducer when equipment 600 moves in one's ear, can cut out display panel 641 and/or backlight.As the one of motion sensor, Gravity accelerometer can detect the size of all directions (are generally three axles) acceleration, size and the direction of gravity can be detected time static, can be used for identifying the application (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating) of mobile phone attitude, Vibration identification correlation function (such as passometer, knock) etc.; As for equipment 600 also other sensors such as configurable gyroscope, barometer, hygrometer, thermometer, infrared ray sensor, do not repeat them here.
Voicefrequency circuit 660, loudspeaker 621, microphone 622 can provide the audio interface between user and equipment 600.Voicefrequency circuit 660 can by receive voice data conversion after electric signal, be transferred to loudspeaker 621, by loudspeaker 621 be converted to voice signal export; On the other hand, the voice signal of collection is converted to electric signal by microphone 622, voice data is converted to after being received by voicefrequency circuit 660, after again voice data output processor 680 being processed, through RF circuit 610 to send to another equipment, or export voice data to storer 620 to process further.Voicefrequency circuit 660 also may comprise earphone jack, to provide the communication of peripheral hardware earphone and equipment 600.
WiFi belongs to short range wireless transmission technology, and equipment 600 can help user to send and receive e-mail by WiFi module 670, browse webpage and access streaming video etc., and its broadband internet wireless for user provides is accessed.Although Fig. 6 shows WiFi module 670, be understandable that, it does not belong to must forming of equipment 600, can omit in the scope of essence not changing invention as required completely.
Processor 680 is control centers of equipment 600, utilize the various piece of various interface and the whole equipment of connection, software program in storer 620 and/or module is stored in by running or performing, and call the data be stored in storer 620, the various function of actuating equipment 600 and process data, thus integral monitoring is carried out to equipment.Optionally, processor 680 can comprise one or more process core; Optionally, processor 680 accessible site application processor and modem processor, wherein, application processor mainly processes operating system, user interface and application program etc., and modem processor mainly processes radio communication.Be understandable that, above-mentioned modem processor also can not be integrated in processor 680.
Equipment 600 also comprises the power supply 690 (such as battery) of powering to all parts, preferably, power supply can be connected with processor 680 logic by power-supply management system, thus realizes the functions such as management charging, electric discharge and power managed by power-supply management system.Power supply 690 can also comprise one or more direct current or AC power, recharging system, power failure detection circuit, power supply changeover device or the random component such as inverter, power supply status indicator.
Although not shown, equipment 600 can also comprise camera, bluetooth module etc., does not repeat them here.
Equipment 600 also includes storer, and one or more than one program, one of them or more than one program are stored in storer, and be configured to be performed by more than one or one processor, make electronic equipment 600 can perform shown in above-mentioned Fig. 1 or Fig. 2, all or part of step in the method for testing web page performed by electronic equipment.
Those skilled in the art, at consideration instructions and after putting into practice invention disclosed herein, will easily expect other embodiment of the present invention.The application is intended to contain any modification of the present invention, purposes or adaptations, and these modification, purposes or adaptations are followed general principle of the present invention and comprised the undocumented common practise in the art of the present invention or conventional techniques means.Instructions and embodiment are only regarded as exemplary, and true scope of the present invention and spirit are pointed out by claim below.
Should be understood that, the present invention is not limited to precision architecture described above and illustrated in the accompanying drawings, and can carry out various amendment and change not departing from its scope.Scope of the present invention is only limited by appended claim.

Claims (10)

1. to the method that web page is tested, it is characterized in that, described method comprises:
According to the test case object of at least one Test cases technology web page;
By each test case in described test case object, the element to be tested in described web page is tested successively, obtain test result;
Verify described test result, obtain check results, whether described check results is used to indicate described test result correct;
Test report is generated according to described check results;
Described test report is sent to assigned address.
2. method according to claim 1, is characterized in that, is describedly tested the element to be tested in described web page by each test case in described test case object successively, obtains test result, comprising:
When performing a test case in described test case object, locate the position of element to be tested in described web page that described test case is corresponding;
Test operation corresponding to described test case is performed in the position of described element to be tested;
Obtain the test result that described test operation is corresponding.
3. method according to claim 1, is characterized in that, is describedly tested the element to be tested in described web page by each test case in described test case object successively, obtains test result, comprising:
From the configured list pre-set, obtain the test node address that each test environment is corresponding, described test environment is used to indicate the operating system and browser of running described web page;
When performing a test case in described test case object, the test node address corresponding according to each test environment described performs request to the test node transmission that each test environment described is corresponding, described execution in request comprises the position of element to be tested corresponding to described test case in described web page and test operation, and described execution request is used to indicate described test node and performs described test operation in the position of described element to be tested;
Receive the test result that test node corresponding to each test environment described returns.
4. method according to claim 1, is characterized in that, the described test case object according at least one Test cases technology web page, comprising:
Obtain initial path;
The test case file of default naming rule is met under searching for described initial path;
The test case file meeting described default naming rule is added to described use-case object by the mode of searching loop.
5. method according to claim 1, is characterized in that, described described test report is sent to assigned address, comprising:
By lettergram mode, described test report is sent to the addresses of items of mail of specifying.
6. to the device that web page is tested, it is characterized in that, described device comprises:
Object generation module, for the test case object according at least one Test cases technology web page;
Test module, for being tested the element to be tested in described web page by each test case in described test case object successively, obtains test result;
Correction verification module, for verifying described test result, obtain check results, whether described check results is used to indicate described test result correct;
Report generation module, for generating test report according to described check results;
Report sending module, for being sent to assigned address by described test report.
7. device according to claim 6, is characterized in that, described test module, comprising:
Positioning unit, for when performing a test case in described test case object, locates the position of element to be tested in described web page that described test case is corresponding;
Test cell, for performing test operation corresponding to described test case in the position of described element to be tested;
Result acquiring unit, for obtaining test result corresponding to described test operation.
8. device according to claim 6, is characterized in that, described test module, comprising:
Address acquisition unit, for obtaining test node address corresponding to each test environment from the configured list pre-set, described test environment is used to indicate the operating system and browser of running described web page;
Request transmitting unit, for when performing a test case in described test case object, the test node address corresponding according to each test environment described performs request to the test node transmission that each test environment described is corresponding, described execution in request comprises the position of element to be tested corresponding to described test case in described web page and test operation, and described execution request is used to indicate described test node and performs described test operation in the position of described element to be tested;
Result receiving element, for receiving the test result that test node corresponding to each test environment described returns.
9. device according to claim 6, is characterized in that, described object generation module, comprising:
Path acquiring unit, for obtaining initial path;
File search unit, for meeting the test case file of default naming rule under searching for described initial path;
Adding device, adds the test case file meeting described default naming rule to described use-case object for the mode by searching loop.
10. device according to claim 6, is characterized in that, described report sending module, for described test report being sent to by lettergram mode the addresses of items of mail of specifying.
CN201610066753.1A 2016-01-29 2016-01-29 Method and device for testing web page Pending CN105528297A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610066753.1A CN105528297A (en) 2016-01-29 2016-01-29 Method and device for testing web page

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610066753.1A CN105528297A (en) 2016-01-29 2016-01-29 Method and device for testing web page

Publications (1)

Publication Number Publication Date
CN105528297A true CN105528297A (en) 2016-04-27

Family

ID=55770540

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610066753.1A Pending CN105528297A (en) 2016-01-29 2016-01-29 Method and device for testing web page

Country Status (1)

Country Link
CN (1) CN105528297A (en)

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106354638A (en) * 2016-08-29 2017-01-25 广州唯品会信息科技有限公司 Automatic testing method and device based on lexical analysis
CN106991045A (en) * 2017-03-24 2017-07-28 广州酷狗计算机科技有限公司 Page method of calibration and device
CN106991048A (en) * 2017-03-31 2017-07-28 杭州迪普科技股份有限公司 Webpage method of testing and device
CN107085553A (en) * 2017-03-07 2017-08-22 深圳国泰安教育技术股份有限公司 An input box testing method and device
CN107368425A (en) * 2017-08-25 2017-11-21 郑州云海信息技术有限公司 A kind of openstack method of testings
CN107402880A (en) * 2016-05-20 2017-11-28 腾讯科技(北京)有限公司 A kind of method of testing and electronic equipment
CN107423215A (en) * 2017-04-25 2017-12-01 丹露成都网络技术有限公司 A kind of WEB page performs the method tested and generate test report automatically
CN107608690A (en) * 2017-08-09 2018-01-19 华为软件技术有限公司 The method and device of configuration management
CN107957955A (en) * 2017-12-22 2018-04-24 广东睿江云计算股份有限公司 A kind of automated testing method based on case management system
CN108153667A (en) * 2016-12-06 2018-06-12 北京奇虎科技有限公司 Automated testing method, apparatus and system
CN108845929A (en) * 2018-05-07 2018-11-20 北京三快在线科技有限公司 Page performance test method and apparatus
CN109739751A (en) * 2018-12-19 2019-05-10 贵阳朗玛信息技术股份有限公司 Realize the method and system of webpage automatic test
CN110196614A (en) * 2019-05-21 2019-09-03 苏州浪潮智能科技有限公司 The method and device in the time zone WEB page UTC of automated setting BMC
CN110727591A (en) * 2019-10-11 2020-01-24 集奥聚合(北京)人工智能科技有限公司 Modeling page-based automatic testing method
CN110737581A (en) * 2018-07-20 2020-01-31 北京君正集成电路股份有限公司 testing methods and devices
CN110737597A (en) * 2019-10-15 2020-01-31 北京弘远博学科技有限公司 UI layer automatic testing method based on education training platform
CN111221572A (en) * 2020-01-13 2020-06-02 北京字节跳动网络技术有限公司 Method, device, medium and equipment for automatically adapting to operating environment
CN111367802A (en) * 2020-02-29 2020-07-03 中国平安财产保险股份有限公司 Web automatic testing method and device and computer readable storage medium
CN111930629A (en) * 2020-08-14 2020-11-13 工银科技有限公司 Page testing method and device, electronic equipment and storage medium
CN112685285A (en) * 2019-10-18 2021-04-20 北京奇虎科技有限公司 User interface test case generation method and device
CN113220587A (en) * 2021-06-02 2021-08-06 中国农业银行股份有限公司 Web interface compatibility testing method and device
CN113835993A (en) * 2020-06-23 2021-12-24 网神信息技术(北京)股份有限公司 Automatic testing method, device, testing platform, electronic equipment and storage medium
CN114676034A (en) * 2020-12-24 2022-06-28 腾讯科技(深圳)有限公司 Test method, test device and computer equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521121A (en) * 2011-11-18 2012-06-27 华为技术有限公司 Page testing method and page testing device
US20130007711A1 (en) * 2011-06-29 2013-01-03 Fryc Lukas Unified model for visual component testing
US20130042222A1 (en) * 2011-08-08 2013-02-14 Computer Associates Think, Inc. Automating functionality test cases
CN103186466A (en) * 2011-12-31 2013-07-03 中国银联股份有限公司 Information interaction device and method based on automatic generation of associated test cases
CN103377101A (en) * 2012-04-18 2013-10-30 百度在线网络技术(北京)有限公司 Testing system and testing method
CN103984628A (en) * 2014-05-15 2014-08-13 中国南方航空股份有限公司 Automatic function test method and system applied to BS (browser/server) framework
CN104424087A (en) * 2013-08-21 2015-03-18 阿里巴巴集团控股有限公司 Web page element positioning method, apparatus and system
CN104601403A (en) * 2015-01-07 2015-05-06 上海瀚之友信息技术服务有限公司 Automatic test system
CN104820640A (en) * 2015-05-19 2015-08-05 广州华多网络科技有限公司 Method and device for web page testing
CN105260299A (en) * 2015-09-17 2016-01-20 安一恒通(北京)科技有限公司 Method, device, and system for software test

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130007711A1 (en) * 2011-06-29 2013-01-03 Fryc Lukas Unified model for visual component testing
US20130042222A1 (en) * 2011-08-08 2013-02-14 Computer Associates Think, Inc. Automating functionality test cases
CN102521121A (en) * 2011-11-18 2012-06-27 华为技术有限公司 Page testing method and page testing device
CN103186466A (en) * 2011-12-31 2013-07-03 中国银联股份有限公司 Information interaction device and method based on automatic generation of associated test cases
CN103377101A (en) * 2012-04-18 2013-10-30 百度在线网络技术(北京)有限公司 Testing system and testing method
CN104424087A (en) * 2013-08-21 2015-03-18 阿里巴巴集团控股有限公司 Web page element positioning method, apparatus and system
CN103984628A (en) * 2014-05-15 2014-08-13 中国南方航空股份有限公司 Automatic function test method and system applied to BS (browser/server) framework
CN104601403A (en) * 2015-01-07 2015-05-06 上海瀚之友信息技术服务有限公司 Automatic test system
CN104820640A (en) * 2015-05-19 2015-08-05 广州华多网络科技有限公司 Method and device for web page testing
CN105260299A (en) * 2015-09-17 2016-01-20 安一恒通(北京)科技有限公司 Method, device, and system for software test

Cited By (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107402880A (en) * 2016-05-20 2017-11-28 腾讯科技(北京)有限公司 A kind of method of testing and electronic equipment
CN107402880B (en) * 2016-05-20 2020-10-16 腾讯科技(北京)有限公司 Test method and electronic equipment
CN106354638A (en) * 2016-08-29 2017-01-25 广州唯品会信息科技有限公司 Automatic testing method and device based on lexical analysis
CN108153667B (en) * 2016-12-06 2023-05-30 三六零科技集团有限公司 Automatic test method, device and system
CN108153667A (en) * 2016-12-06 2018-06-12 北京奇虎科技有限公司 Automated testing method, apparatus and system
CN107085553A (en) * 2017-03-07 2017-08-22 深圳国泰安教育技术股份有限公司 An input box testing method and device
CN107085553B (en) * 2017-03-07 2020-05-19 深圳国泰安教育技术有限公司 A kind of input box testing method and device
CN106991045A (en) * 2017-03-24 2017-07-28 广州酷狗计算机科技有限公司 Page method of calibration and device
CN106991048A (en) * 2017-03-31 2017-07-28 杭州迪普科技股份有限公司 Webpage method of testing and device
CN107423215A (en) * 2017-04-25 2017-12-01 丹露成都网络技术有限公司 A kind of WEB page performs the method tested and generate test report automatically
CN107608690A (en) * 2017-08-09 2018-01-19 华为软件技术有限公司 The method and device of configuration management
CN107368425A (en) * 2017-08-25 2017-11-21 郑州云海信息技术有限公司 A kind of openstack method of testings
CN107957955A (en) * 2017-12-22 2018-04-24 广东睿江云计算股份有限公司 A kind of automated testing method based on case management system
CN108845929A (en) * 2018-05-07 2018-11-20 北京三快在线科技有限公司 Page performance test method and apparatus
CN110737581A (en) * 2018-07-20 2020-01-31 北京君正集成电路股份有限公司 testing methods and devices
CN109739751A (en) * 2018-12-19 2019-05-10 贵阳朗玛信息技术股份有限公司 Realize the method and system of webpage automatic test
CN110196614A (en) * 2019-05-21 2019-09-03 苏州浪潮智能科技有限公司 The method and device in the time zone WEB page UTC of automated setting BMC
CN110727591A (en) * 2019-10-11 2020-01-24 集奥聚合(北京)人工智能科技有限公司 Modeling page-based automatic testing method
CN110737597A (en) * 2019-10-15 2020-01-31 北京弘远博学科技有限公司 UI layer automatic testing method based on education training platform
CN112685285B (en) * 2019-10-18 2025-03-28 北京奇虎科技有限公司 User interface test case generation method and device
CN112685285A (en) * 2019-10-18 2021-04-20 北京奇虎科技有限公司 User interface test case generation method and device
CN111221572A (en) * 2020-01-13 2020-06-02 北京字节跳动网络技术有限公司 Method, device, medium and equipment for automatically adapting to operating environment
CN111221572B (en) * 2020-01-13 2023-09-01 北京字节跳动网络技术有限公司 Method, device, medium and equipment for automatically adapting to running environment
CN111367802A (en) * 2020-02-29 2020-07-03 中国平安财产保险股份有限公司 Web automatic testing method and device and computer readable storage medium
CN111367802B (en) * 2020-02-29 2024-06-25 中国平安财产保险股份有限公司 Web automatic test method, device and computer readable storage medium
CN113835993A (en) * 2020-06-23 2021-12-24 网神信息技术(北京)股份有限公司 Automatic testing method, device, testing platform, electronic equipment and storage medium
CN111930629A (en) * 2020-08-14 2020-11-13 工银科技有限公司 Page testing method and device, electronic equipment and storage medium
CN114676034A (en) * 2020-12-24 2022-06-28 腾讯科技(深圳)有限公司 Test method, test device and computer equipment
CN113220587A (en) * 2021-06-02 2021-08-06 中国农业银行股份有限公司 Web interface compatibility testing method and device

Similar Documents

Publication Publication Date Title
CN105528297A (en) Method and device for testing web page
CN105824958B (en) A kind of methods, devices and systems of inquiry log
CN104639672B (en) The method and apparatus for carrying out domain name mapping
CN103294515B (en) A kind of methods, devices and systems for obtaining application program
CN104618217B (en) Share method, terminal, server and the system of resource
CN105320598A (en) Software testing method and device
CN105630685A (en) Method and device for testing program interface
CN107094294A (en) Method for connecting network and device
CN104104711B (en) Reading histories treating method and apparatus
CN104426962A (en) Multi-terminal binding method, binding server, terminal and multi-terminal binding system
CN108536594A (en) Page test method, device and storage device
CN104468101A (en) User identity authentication method and device and authentication service system
CN104636255A (en) Method and device for testing webpage application display effect
CN104298666A (en) Web page sharing method and web page sharing device
CN104077211A (en) Test method and test system for mobile terminal software
CN105740145A (en) Method and device for locating element in control
CN105530239A (en) Multimedia data obtaining method and device
CN104699501A (en) Method and device for running application program
CN106161147B (en) Establish the method and device of network connection
CN104063400A (en) Data search method and data search device
CN111177612A (en) Method and related device for authenticating page login
CN104660769A (en) Method, device and system for adding contact person information
CN104391629B (en) The method of directive sending message, the method for display message, server and terminal
CN104133693B (en) Installment state detection method, device and terminal
CN103944922B (en) Data processing method, terminal, server and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 510660 Guangzhou City, Guangzhou, Guangdong, Whampoa Avenue, No. 315, self - made 1-17

Applicant after: Guangzhou KuGou Networks Co., Ltd.

Address before: 510000 B1, building, No. 16, rhyme Road, Guangzhou, Guangdong, China 13F

Applicant before: Guangzhou KuGou Networks Co., Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160427