SeleniumSelenium is a Web automation testing tool, originally developed for website Automation testing, type like we play the game with the Key wizard, can be automatically operated according to the specified command, the difference is that selenium can run directly on the browser, It supports all major browsers (including PHANTOMJS, which are non-interface browsers).Selenium can use our instructions to let
installing selenium, the general choice Selenium2.0 above, Selenium3.0 the following version is more appropriate. To install a version of selenium, you need to specify a version number to install in the command, for example:>>>pip Install selenium==2.53.04, jetbrains pycharm installationJetBrains Pycharm is a compiler for the Python development environment. Pych
Function Introduction: Use Selenium and Chrome browser, let it automatically open Baidu page, and set to show 50 per page, and then in Baidu Search box input selenium, to query. Then open the page and select "Selenium-Open source China community" and open the page Knowledge Brief: The role of Selenium: 1. Originally us
Why do you choose Python?
Before the rookie series is based on Java, a year did not learn to forget almost, the current product part of the test is also written in Python, and the team is also promoting Python, in fact, for testers, Python is also quite popular. Easy to learn, easy to use. The probability of Python appearing is also quite high when you flip through the test jobs.
Platform setup:
Already introduced in the previous article, if you also want to experience the charm of automation
refers to the handling of alert, where we do not need to delete it. and save the test case as login. 6. Log out and adjust the speed to normal, click on Play current test case, you can find that the login is successful!7. Finally, according to the same method (try, very simple) registered users are also automated registration, and saved as register, then you can quickly based on the name of test case automated testing.
A little idea:Selenium IDE can only be used in Firefox, then other bro
Explanation of Python selenium three waiting Methods: pythonselenium
I found that too many people will not wait. Today, the bloggers cannot help but tell you the necessity of waiting.
Many people ask in the group that the drop-down box cannot be located, the pop-up box cannot be located... In most cases, there are two problems: frame and wait. I don't know what kind of speed your code is running, but what k
Originally built an automated testing framework, vaguely superficial understanding, is to build a only can be used, is not the framework of the thing.Now look back and see how each step is connected and how it works.This blog first talk about the parts are what.Introduction of each part: Jenkins:The mention of Jenkins does not have to be continuous integration. Jenkins is a very well-developed open source software for continuous integration, and Jenkins itself is a Java open source project that
put it in a directory that has been configured with environment variables, such as C:\Program Files (x86)
Installing the Chromedriver-binary Package
"Pycharm" > "File" > "Settings" > "Project Interpreter" > "+" > "BEAUTIFULSOUP4" > "Install"
Specific operation:You can use it when you're ready to install it.
Selenium operation
Selenium operations are divided into two ma
determine whether there is a Selenium official website this link.
7 exit the browser and end the test.
If you don't get the element's expression through the plugin Firepath on Firefox, see an article. If you don't have Chrome installed, use Firefox.
1 Desktop A new Notepad, named and saved as firstscript.py
2 Enter the following code fragment to firstscript.py, save
3 Open the cmd window, switch to the de
("http://www.baidu.com") # Load pageAssert "Yahoo! "In browser. TitleELEM = browser. find_element_by_name ("p") # Find the query boxELEM. send_keys ("seleniumhq" + keys. Return)Time. Sleep (0.2) # Let the page load, will be added to the APITry:Browser. find_element_by_xpath ("// A [contains (@ href, 'HTTP: // seleniumhq.org ')]")Except t nosuchelementexception:Assert 0, "can't find seleniumhq"Browser. Close ()
7. Solution to ie failureThe problem is as follows: (I use Python)Webdriverexception:
command:Java-jar Selenium-server-standalone-3.5.2.jar-role Hub 3. Install node: Similarly, put the downloaded Selenium-server-standalone-3.5.2.jar on the B machine and run the command:Java-jar selenium-server-standalone-3.5.2.jar-role node-port 6666-hub http://10.189.1.206:4444/grid/registerThe address of the hub must be specified here, and the port number (por
#downloading-python-bindings-for-seleniumTest ScriptsThe following script implementation, open the Baidu Web page, search for a keyword, followed by three browsers (Firefox IE Chrome).1 #Import OS2 Import Time3 fromSeleniumImportWebdriver4 fromSelenium.webdriver.common.keysImportKeys5 6 #Test case7 defTestbrowser (Driver):8Driver.get ("http://www.baidu.com")9DRIVER.FIND_ELEMENT_BY_ID ("kw"). Click ()TenDRIVER.FIND_ELEMENT_BY_ID ("kw"). Clear () OneDRIVER.FIND_ELEMENT_BY_ID ("kw"). Send_keys ("
,/http download.csdn.net/detail/u014427391/94543983. Install Selenium-ide,selenium-ide.xpi to Firefox, and the prompt will appear:You can install it all here4. Use Selenium-ide to record a webOpen Firefox, press ALT to display the toolbar (some Firefox toolbars are hidden, to press the ALT key to display), if the selenium
The first three articles describe the installation process and the ability to access the Firefox browser via selenium and automatically search for "Eastmount" keywords. This article mainly briefly describes how to implement automatic login 163 mailbox, while continuing to introduce Selenium+python official website locating elements part of the content.Hope that the basic article is helpful to you, if there
Transferred from: http://smilejay.com/2012/09/selenium-webdriver-with-ie/The Java code below is to open IE browser and then search Google for the "smilejay" keyword.[Copy to clipboard]View Code JAVA
1234567891011121314151617181920212223242526272829303132333435363738
Package Com.selenium.test;import Org.openqa.selenium.ie.internetexplorerdriver;i
(SELENIUM-RC), to do this requires more coding, but it's not difficult. First check the element, if it exists, wait for a predefined period of time, and then recheck. This executes within the loop, and terminates the loop if the element does not exist if it exceeds a predetermined timeout.Let's consider a link to the Ajax effect on the page (link = ajaxlink), which you can use for loop processing:
Loop initialization.for (int second =
. The second is dynamic loading, the URL is inconvenient to use but can page, such as CSDN.At the same time the position of the next page is constantly changing, may be the 5th If this is the picture above, you can get class= "next", but if it is like Csdn page number, how to solve it? Do I currently want to get "next" text or analog http? Or get JS? Headache. is the Python code that jumps once to the next page, where:NextPage = Driver.find_element_by
(Python GUI) program, and start with an interactive mode. You can enter: from selenium import WebdriverThe above command is to import selenium related packages, if no error after carriage return indicates that our selenium installation is successful.CTRL + N or file->new file opens a new window and enters the following code
Recently bored. and re-installed a selenium.The Times have changed. The method of installation is not the same as it used to be. It is therefore felt necessary to make a separate statementAnother remark: test the small friends. Error installing such tools. Try one of the following two scenarios:1. Please go to StackOverflow2.code ReviewHere's a second way to fix the installation problemIf you're looking at an unofficial document, use the installation
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.