Jenkins+selenium can achieve continuous integration of web automation.
The basic operation of Jenkins:
First, new view and job
New View:
New job:
You can choose to build a free-style software project or copy an existing item
Ii. Preparatory work:
Install Jenkins plugin, SSH plugin, Email Extension plugin, Hudson SELENIUMHQ plugin
Click System Management, manage plugins
Enter the plugin name in
running test:The result of the operation is as follows: we can see the test results of the corresponding method in the console.As you can see from the summary information, a total of two test methods have been run, one of which failed, and we can see that there is an exception that locate the link element, and under the Results of running Suite column, you can see whether the test results pass the message:Method Testb Test Failed, this is due to input in the method Testb garbled linktext caused
I. SELENIUM2 webdriver
When selenium2.x presents the concept of Webdriver, it provides a completely different way to interact with the browser
That is, using the browser's native API, encapsulated into a set of more object-oriented selenium Webdriver API, directly manipulate the elements of the browser page, and even manipulate the browser itself (screenshots, window size, start, close, install plug-ins, configuration certificates, etc.)
, direct pip install Selenium and pip install Beautifulsoup4Then is the download installs the Chromedriver driver, the URL is as follows Https://sites.google.com/a/chromium.org/chromedriver/downloads, Remember to configure the environment variable or install it directly under the working directory. (You can also use IE, PHANTOMJS, etc.)Here we first crawl each stock corresponding to the homepage link, the code is as follows (using Python2): 1 #-*-Codi
, all the Web page programming techniques that combine the Advanced programming language and database technology of HTML are dynamic Web pages. --------------------------------------------------------------------It can also be explained that the Dynamic Web page does not execute JavaScript, just using data = Response.read () to get the static HTML is not what you
. Dismiss() # If you have a text box on alert, you can enter text. (Note: not encountered)driver. Switch_to. Alert. Send_keys() # Returns the text content above alerttext = driver. Switch_to. Alert. Text
SelectIn the UI Automation test process, often encounter some drop-down boxes, if we are based on webdriver operation, we need click two times, and very prone to problems, in fact, selenium provides us with a spe
error:unable to discover open pages; baidu, This problem may be browser and driver version incompatibility caused by, The problem is that my chrome version is 46, driver version is too old caused, re-download the new version of the driver update, finally resolved, successfully completed the first stepFeel the process of learning will always encounter a lot of problems, but only serious to study, spend a little time can always solve, oneself too lazy, need to continue refueling, follow-up will c
under the Scripts folder2. Input directive:Pip.exe Install selenium If the progress bar is shown to 100%, it is already installed (if the abnormal cause is exited and you know the progress is up to 100%)3. Selenium can support a lot of browsers, but to install the corresponding browser driver , such as My computer's browser is v56, the corresponding download chromedriver version v2.29(Chrome is used in the
Time: August 6, 2017 night 3:40, insomnia, idle to write an essay on nothing.
A few days ago, my friend asked me if I could help him crawl the text and links of a Web site, want to organize a simple to facilitate learning, website: http://www.bianceng.cn/Programming/cplus/
Requirement: Save the text content and corresponding hyperlinks in the webpage to local, total 60 pages, 1773 items
Consider that the URL of the first page in the page is: http://ww
Don't say much nonsense, just say the point:At the beginning of the time, agent IP, head information pool, have been done, using SELENIUM+PHANTOMJS to get JS dynamic loading of the source codeAt first very good, can come out of the dynamic load after the source code, but after several runs, the computer a little lag (estimated that the storage is too small), the source will not get, the data returnedIt's all empty data, so it's all wrong.Make sure to
Environment: CentOS el7.x86_64 System +python2.7.5+selenium 3.13.0+geckodriver_0.21.0+firefox_60.1.0Issue: Using Browser.execute_script ("window.open (URL)")New link cannot use new tab windowWORKAROUND: Open a new link on this page using Browser.execute_script ("window.open (URL, ' _self ')")The problem still remains: SessionNotCreatedException:Message:Tried to run command without establishing a connection 改变js的方法:browser.execute_scrip
write test frameworks.Since we have used testng, please at least try to use the testng function. For (String winHandle:driver.getWindowHandles ()) { Driver.switchto (). window (winhandle); } This code represents a toggle window. Interestingly, he is in the window open, first take out all the windows of the Hanles, and then one by one cut past.Because the new window must be at the end, no matter how many windows you have, this code will always find the latest
First, install EclipseSpecific can refer to http://jingyan.baidu.com/article/fea4511a130b59f7bb912503.html, step more detailedSecond, build Python+selenium environmentSpecific reference http://wenku.baidu.com/link?url=p6wc6Y2mVjZBb7_FVq41372h-MX4BrRhLccHUREWZqupI6s5Wpie7_ I0mfmtgylvvjnfofvmwta3l8p7rsesrlaag5afatr704yvlupw2dePython currently supports more than 2.7 versions of plug-ins and libraries, 3.X version and 2.7 differences, specific to individu
Use Selenium module to control browser launch Selenium control browserfrom = webdriver. Firefox () brower. Get ('http://www.baidu.com')Find elements in the page fromSelenium Import Webdriverbrowser=Webdriver. Firefox () browser.Get('http://inventwithpython.com')Try: Elem= Browser.find_element_by_class_name ('Row') Print ('found with the that class name'%(Elem.tag_name)) Except:print ('Was wasn't able to fi
Center Calligraphy "Heaven according to the Theory of happiness" 2018 Luo Tian Yi Sheng Christmas Festival "[English subtitled] 8.32/* Luna feat.flower "GENERIC" sister must see me development is not normal! July new Big Spit groove first bomb!" New Wonderful house 07"people really have, animation character homophonic terrier what? "Fill the classroom 06" jumping jumping, and Teresa with the NAP? ~hide and seek~ watch online: 4467291 " # Analog Login Bilibilifrom
Selenium official websitehttp://selenium-python.readthedocs.io/Configuring the Usage environmentDownload the appropriate browser driver, Firefox is the defaultThis article is based on Chrome, placed in the scripts directoryChromedriver official: All versions of ChromedriverDocument referenceA Concise Python tutorialPython Tutorial-LiaocheOfficial document: Selenium
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.