In the actual automated testing process, we will meet many situations that require the processing of Windows. For example, when you click Delete a message, the system displays an alert box. Or when you click a hyperlink, a new page opens in the browser. This article, to share with you the Selenium Webdriver window processing related APIs. Well, let's take a look at the main topics covered in this article as usual:
Window Processing interface:
Selenium is very helpful for our web automation testing, if we want to carry out a wide range of test coverage, we can not only run on one or two machines, the same selenium-grid also provide us with such help, We can easily build a distributed test environment with Selenium-grid. Unlike some of the other common distributed programs "such as: Hudson",
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 Webdriver to provide a more straightforward interface to compensate for SELENIUM
Architecture
This framework is created using ant, testng and selenium.Through this framework, a user is able to create an automatic test case which can be run later by executing a single command. The uses of different frameworks are as follows:Selenium: this framework is needed for recording a testcase, exporting it into Java, and executing it on a browserTestng: this framework is used to organize different tests, and to report results.Ant: Provides the glue to hold everything together, and exe
China-Selenium ERA model development system, selenium era platform model development to find (Ying Hua: 138-0284-9410) Micro-QQ3182291817, selenium era APP development system, selenium era system developer City. China-Selenium Age system model: Sharing bonusesThe investment
SeleniumIsWebOfAutomated TestingTools, andOthersCompared with the automated tools, the main features of the tool are cross-platform and cross-browser.SupportedWindows, Linux, Mac, supporting IE, FF, Safari, opera, chrome, etc.Another feature is the support for distributedTest CasesTo distribute test cases to different test machines, which is equivalent to the distribution machine function.
For the principles, architecture, and usage of selenium, refer
1. First configure the eclipse + pydev EnvironmentA) install JDKB) install eclipseC) install python2.7 and install pydev.2. Go to the official website (http://seleniumhq.org/download/) to download the selenium Python FileClick Download of python to go To the download page of selenium python, https://pypi.python.org/pypi/selenium
3.download
In the production environment, QA will run dozens of hundred test case at the same time. If you use a single machine serial, it is a very time-consuming thing, estimated than the hand point is not much faster. With parallel scenarios, there are two ways to write your own parallel framework, one to use a ready-made selenium Grid.Write your own parallel framework, the advantage is that everything is in control, there are problems can be quickly targeted
I think this article is very interesting, idle to see!Python crawler tutorial -28-selenium manipulating ChromePHANTOMJS Ghost Browser, no interface browser, no rendering page. Selenium + Phantomjs is a perfect match before. Later in 2017, Google announced that Chrome also announced support for non-rendering. So PHANTOMJS use more and less people, it is a pity, this article introduces
pythonhttps://www.python.org/Python is a scripting language that is easy to learn and easy to use, enabling you to quickly implement business logic and integrate systems efficiently.-----Http://zh.wikipedia.org/zh-cn/Python:Its syntax is simple, unlike most other programming languages using curly braces, which use indentation to define a block of statements.Python is often used for web development. For example, with the Mod_wsgi module, Apache can run web programs written in Python. Gunicor writ
With Selenium-ide recording, and writing test cases directly with Selenium-java.jar, you will find that it executes very fast. Much more than the speed of manual operation, and may even exceed the speed of browser loading (faster than the browser?) The result is no element found).If there is an element on the page but is prompted during the test, NoSuchElementException there are two reasons: 1, your strateg
In the daily page source code, we based on the element ID to locate is the most foolproof, the ID in a single page is not duplicated. But in practice, many front-end developers do not write ID attributes for each element. A typical HTML code is as follows:1 Divclass= "Sui-tips s-isindex-wrap sui-tips-exceedtipnews"style= "display:none; width:auto;">Divclass= "Sui-tips-arrow"style= "left:15px;">em>em>Div>Divclass= "Sui-tips-body">Call me too many times today,BR>Let's have a little more of it tomo
-search ')Button.Click ()For more information, see the official documentation:Http://selenium-python.readthedocs.io/api.html#module-selenium.webdriver.remote.webelementTo execute the action chain:It doesn't feel like much, see the official documentation.Http://selenium-python.readthedocs.io/api.html#module-selenium.webdriver.common.action_chains4 Get Property Display Propertiesinput = Browser.find_element_b
Input Box Input:1. Locate the ID of the input box and enter the actionordinal: Input box Idparameter: The content to be entered Browser.execute_script ("document.getElementById (\ ' ) " " \ '). Value=\ '""\ "; ")ELEMENT click:1: Find the Element (selenium one of the 8 ways to find the element) object and then clickPython:= Browser.find_element_by_css_selector (prompt) Browser.execute_script ("Arguments[0].click ( ); ", confirm)Java:1. Define the Javas
Web developers often need to use the JavaScript pop-up dialog box to give users some informational hints, including the following types
Reading Table of Contents
dialog box type
Test page
Code for the Selenium Action dialog box
dialog box type
1. Warning Boxes: Validation results, errors or warnings for prompting user related information
2. Hint box: Used to prompt the user to enter data in the current dialog box, generally requ
Locating page elements
For many selenium commands, the target domain is required. Target recognizes the UI element within the Web page scope, and it uses the locatortype=location format. In many cases, locatortype can be omitted, and the following examples are used to describe various types of locatortype.
If so, there is an HTML code that reads:
html>
Let's take a look at how selenium offers tho
A good starting point for learning UnitTest is to record the export script from the selenium IDE. I believe many novice learning selenium also started from IED.
Using an IED to record a script
Export the script, save it as baidu.py, and open it through the Python idle editor. As follows:
From selenium import Webdriver to selenium.webdriver.common.by impor
Using the relevant technology: Selenium+testng+log4j+maven
Selenium primarily generates driver, gets page elements, and so on.
TestNG main Run program, generate test reports, manage use case execution order, assert, etc.
LOG4J is primarily used to print log logs.
Maven primarily manages the externally introduced jar package, which includes the management of the selenium
From graduation to now are engaged in functional testing work, functional testing for a long time, people will be more confused. have been thinking about self-taught automated testing, always think that as long as the learning LoadRunner or QTP This business-level tools will be automated testing, so busy for a while, the tool will use the basic or automated testing of laymen.Unwilling to heart ah, go to the Big forum or blog, found cattle people do web automation testing with the
1. Download necessary tools and jar packages
1. Download and install Firefox
(1) download selenium ide
Http://release.seleniumhq.org/selenium-ide/1.9.0/selenium-ide-1.9.0.xpi
(2) download test suite batch Converter
Https://addons.mozilla.org/en-US/firefox/addon/test-suite-batch-converter-sel/
(3) install the Firefox plug-in
Drag the attachment to be installed to
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.