Environment Preparation:1. Download the Learning installation package:Setuptoolshttps://pypi.python.org/packages/2.7/s/setuptools/SeleniumHttps://pypi.python.org/pypi/selenium2. Installation1). Install Setuptools (Note that this must be installed, otherwise the installation selenium will be error)python2.7 Enter the Windows command prompt to execute ez_setup.py:To this setuptools installation succeeded2).
(' login ') signin_submit_ Button.Click () Time.sleep (2) # Exit Driver.close ()This is one of the simplest examples of Python selenium, and the added functionality will be based on a simple example of this extensionThen give an example of the official website, you can analyze, analysis can be confirmed by the last officer net, attached linkFrom selenium import
) is checked. fails if the specified element doesn ' T exist or isn ' t a toggle-button. Get_alert (): Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no Al ERTs. Getting an alert has the same effect as manually clicking OK. If an alert are generated but you don't consume it with Getalert, the next Selenium actionn Bsp would fail. Under Selenium, JavaS
begins
personal Blog "Python+selenium GUI Automation implementation" mentioned in Chrome and IE browser call plugin has been uploaded to 51CTO download, the corresponding links are : Chrome,/http/ Down.51cto.com/data/2171584;ie,http://down.51cto.com/data/2171585; direct download is required; Body
With regard to automation, the essence is to use machine operation instead of manual execution, ther
SceneThe positioning and operation of the test object is the core content of Webdriver, and the operation is based on the positioning, so the object positioning becomes more and more important.The purpose of locating objects generally has the following types of
Manipulating objects
Gets the properties of the object, such as the class property of the test object, the Name property, and so on
Gets the text of the object
Get the number of objects
Webdriver provides a serie
This essay is a loose-set. No more forcing you to do it directly.
Step 1: use Webdriver to invoke the browser, Webdriver supported browsers for Firefox (), IE (), Chrome (), different browsers need to install different drivers.This article uses the Firefox browser: Webdriver. Firefox (), open a URL by using the Get () function. from Import Webdriver Import = webdriver. Firefox () driver.get ("http://172.18.xxxxxxxxxxxxx.jsp"# Maximize Browser d
= ' 03913f358d9be352bd125ae7087dd0d6.apk ' and @class = ' Xj9qoe ')") - ifLen (new) ==1: - Print "upload apk OK" - Else: in Print "Upload apk failed" -Driver.quit ()1.2 Using the AutoIt toolThe following article is excerpted from http://blog.csdn.net/huilan_same/article/details/522083631.3 Using the Win32 GUIThe following article is excerpted from http://blog.csdn.net/huilan_same/article/details/52439546Note: Multiple file uploads, you can add a file path to the list and then read and
solve the problem of crawling dynamic sites? The answer is to use the selenium library to simulate the browser open page loading completely after processing. This solution can refer to the blog post, which summarizes 4 scenarios in which the use of selenium is better suited for this task.This article gives a picture crawler based on Soso search engine, which is the same for Google and 360 good search metho
Objective:
Environment configuration: WINDOWS64, python3.4
Requests Library Basic operations:
1. Installation: Pip Install requests2, Function: Use requests Send network request, can implement the same as the browser to send various HTTP requests to obtain the data of the website.3. Command set operation:Import Requests # importing requests Module R = Requests.get ("https://api.github.com/events") # Get a page # set timeout, Stop w
Since 2016 know Python, will only use Telnet or SSH to operate the network device implementation of automatic command, the Web interface of the device basically helpless, until recently job-hopping company is all convinced that the service equipment, the background is ssh, sorry, not open to customers, SNMP OIDs only provide so few, to bulk operation, deep convincing advice is to buy the central manager, unified device version, I go nm ... Later found
Download plugin:
Python:https://wiki.jenkins-ci.org/display/jenkins/python+pluginRobotframework:https://wiki.jenkins-ci.org/display/jenkins/robot+framework+pluginSelenium:https://wiki.jenkins-ci.org/display/jenkins/selenium+plugin
Plugin use:
Place the downloaded. hpi file in this directory:D:\apache-tomcat-7.0.67\webapps\jenkins\WEB-INF\plugins (Tomcat installation directory)
Wh
About Selenium + python webdirver Google browser and IE driver configuration, when using these two browsers, you need to configure the driver to add to path, in addition to the other is to add the path, no need to configure the PATH environment variableTo add a case, add it according to the path location:Browser=webdriver. Chrome (' C:/users/wuzhiyi/appdata/local/google/chrome/application/chromedriver.exe '
Use Python+selenium automation to do a cnblog login test, can be used for reference! The following includes the test code and each of the test cases:The login test of the Cnblog is divided into the following situations: (1) The username and password are correct (2) The username is correct, the password is incorrect (3) The username is correct, the password is blank (4) The user name is wrong, the password i
Web login testing is a very common test! Manual test Everyone is familiar with, how to do automated login test it! The author of this paper uses Python+selenium Automation to do a simple but relatively complete cnblog login test, to provide you with a point of reference! The following includes the test code and each of the test cases:The login test of the Cnblog is divided into the following situations: (1)
a prefaceThe core idea of Web UI Automation is to find elements, and then manipulate the two elements. In the Python Selenium series (ii) Element positioning method article, which describes how to find an element, this article describes the second item, how to manipulate the elements that have already been found.Classification of two operation methodsOverall, the operation can be broadly divided into four c
()
driver.implicitly_wait (10) # Implicit wait and explicit wait can be used at the same time, but note that the longest wait time is the greater of
driver.get (‘https://xuehu365.com’)
locator = (By.LINK_TEXT, ‘CSDN’)
try:
WebDriverWait (driver, 20, 0.5) .until (EC.presence_of_element_located (locator))
print driver.find_element_by_link_text (‘CSDN’). get_attribute (‘href‘)
finally:
driver.close ()
In the example above, we set the implicit wait and explicit wait, in other operations, the
elementFind_element_by_partial_link_text (Link_text) find_elements_by_partial_link_text (Link_text)#Find part of a link to an element of textFind_element_by_tag_name (name) find_elements_by_tag_name (name)#Find the label name of an elementFind_element_by_xpath (XPath)#Find XPath for an element Find_elements_by_xpath (XPath) # find child elements within an element Xpath Find_element_by_class_name (name) # Find the class name of an element find_elements_by_ Class_name (name) # Find the class na
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.