Alibabacloud.com offers a wide variety of articles about selenium webdriver python documentation, easily find your selenium webdriver python documentation information here online.
Sometimes in order to ensure the stability of the script run, you need to add the wait time in the script. Add hibernation
Import timeTime.sleep (0.3)Implicit wait
Set once, and after the element is not found, it will wait for 30s by default until the element is found. That is, there is a 30s waiting buffer to find the element. Driver.implicitly_wait (30) Explicit wait
Webdriverwait (). until () #10s内每隔500毫秒扫描一次页面变化, locate the UL element with ID dropdown1 webdriverwait (driver, ten). Until (
cookie value
Delete Browser so the cookies
Method: Delete_all_cookies () instance: Driver.delete_all_cookies ()
Delete a specified cookie
method: Delete_cookie (name) instance: Deriver.delete_cookie ("my_cookie")
Add cookies
method: Add_cookie (cookie_dict) instance: Driver.add_cookie ({'name':' Xiaoqiang'# Note that what is needed here is a dictionary
Gets the current window's
Method: Save_screenshot ( ' image storage Path/image name ')
? SeleniumwebdriverNote: We are working on perfecting each chapter of the Help guide, although there are still areas to be perfected, but we firmly believe that the help information you see today is accurate, and we will provide more guidance to refine the help documentation.1.WebDriver IntroductionThe main new feature of Selenium2.0 is the integration of WEBDRIVERAPI. We designed
SeleniumwebdriverNote: We are working on perfecting each chapter of the Help guide, although there are still areas to be perfected, but we firmly believe that the help information you see today is accurate, and we will provide more guidance to refine the help documentation.1.WebDriver IntroductionThe main new feature of Selenium2.0 is the integration of WEBDRIVERAPI. We designed
compatibility-test your application to see if it works well on different browsers and operating systems, test system functions-Create regression tests to verify software functionality and user needs, support automatic recording actions, and automatically generate. NET, Perl, Python , and test scripts in different languages such as Ruby and Java. Selenium is an acceptance testing tool ThoughtWorks specifica
selenium RC provides a dictionary-based API, all of which are open in one class, and the Webdriver API is more object-oriented. In addition, Webdriver only supports Java, while Selenium RC offers a wide range of language support. The technical differences are also obvious: Seleniu
browser, using the browser's built-in JavaScript translator to translate and execute the Selenese command (Selenese is a collection of Selenium commands).
Webdriver directly controls the browser via native browser support or browser extensions. Webdriver is developed for each browser, replacing JavaScript embedded in the Web app under test. Tight integration
use, basically can meet the work encountered in the application of the mouse keyboard operation.The second thing to note is Webdriver support for browsers, Selenium Webdriver supports a wide range of browsers, from IE, Firefox, Chrome to Safari and other browsers, Webdriver There are corresponding implementations: Int
to be uploaded, doing a single upload action for (charsequence file:files) { uploadbutton.sendkeys (file); } Thread.Sleep (+); System.out.println ("Upload End"); }When execution finishes, the effect is 1.Figure 1. Uploading files in bulkBack to top of pageConclusionIn Selenium Webdriver, with the actions class and the Keys enumeration on the keyboard and mouse operation has been done very in place, co
("Upload End"); }When execution finishes, the effect is 1.Figure 1. Uploading files in bulkConclusionIn Selenium Webdriver, with the actions class and the Keys enumeration on the keyboard and mouse operation has been done very in place, combined with Java itself Robot, KeyEvent and other classes of use, basically can meet the work encountered in the application of the mouse keyboard operation.The second t
, see the author's previous blog about rest (http://blog.csdn.net/ant_yan/article/details/7963517)
For details about the WebDriver wire protocol, for example, if you want to know what the web service can do, you can read the official selenium Protocol documentation. In the source code of selenium, we can find an httpc
step size parameters)
Selenium WebDriver can also be called by a cross-Server Browser through Selenium Standalone Server. For details, see the official documentation.
The WebDriver. Timeouts interface also has two other methods: setScriptTimeout () and implicitlyWait ():
Yo
. Webdriver Support
Firefox (Firefoxdriver)
IE (Internetexplorerdriver)
Opera (Operadriver)
Chrome (Chromedriver)
and Safari (Safaridriver)
It also supports mobile application testing for Android (selendroid) and iphone (Appium). In addition, the Selenium 2 also includes htmlunit based interface-free implementations, called Htmlunitdriver, and WebKit based UI-free browser phantomjs. The
The learning of interface testing is over, and then we're going to start the UI Automation course, and here's the tutorial for UI Automation, please prepare your environment carefully. Ask me whenever you have questions!! 1, installation Professional version pycharm, as long as the licensed are filled in the professional version of the pycharm 2, Python Install Selenium package PIP install
: AutoIt, Pyvirtualdisplay, browser settings, and more.comparison of the efficiency of several PC end driver :[python] view plaincopy650) this.width=650; "src=" Https://code.csdn.net/assets/CODE_ico.png "alt=" Check the code for "width=" height= "/>650" this.width=650; src= "Https://code.csdn.net/assets/ico_fork.svg" alt= " Derive to my code slice "width=" "height=" "/>"
fromseleniumimportwebdriverimporttimedrivers =[' htmlunit ', ' phantomjs ', '
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.