selenium2.0 Basic Concepts

Source: Internet
Author: User

About SELENIUM1. A description of X can look at this article: http://blog.csdn.net/five3/article/details/6790925

Selenium mainly through the selenium RC as a proxy successfully using the browser homology policy, inject automation additional JS script to support automated testing; so selenium1. All components of x include: Ide,rc,grid; and selenium2. X began to introduce the concept of webdriver, with Webdriver do not need to pass the additional JS in support automation control, so there is no need to crack the same origin, there is no need for agents. So 2. The components starting with X are: Ide,webdriver,selenium Server,grid.

Why does selenium have one more component since the original RC was replaced with Webdriver? That's because Webdriver can only support local browser drivers, and if you want to test your browser on a remote host, you need to use Selenium server to do the communication and instruction transfer, and also to be forward compatible selenium1. X's automation script, selenium server additional functionality is actually equivalent to SELENIUM1. The RC component in X.

Take a look at what each component does, and the IDE is a plug-in above the FF that records the user's actions on the page and can then be converted to the corresponding version of the languages supported by the various selenium. This to a certain extent to reduce the difficulty of some people learning, but this is not a permanent, as the QTP recording function like, the introduction can but not to delve into this. Of course there are some other gadgets that can help you learn to debug your automation scripts.

Selenium2. X Webdriver according to different languages have different versions, installation must be on, want to use more than one language, it is necessary to install multiple language version of the Webdriver. In fact, another automation tool, Watir, whose language is Ruby, is driven by the use of Ruby's webdriver as its base in selenium2.x. Because of the preference for Python, the Python language is used when setting up the environment, in which case we can actually base selenium2. The Python webdriver in x encapsulates a python version of the class Watir automation tool. This is something, if you feel that the native selenium is not good to make or not easy for some people to learn. Can consider to do an open source project, interested students can communicate more. Concrete environment construction see here, http://blog.csdn.net/five3/article/details/7030704.
In fact, with the language and the corresponding webdriver can be tested and experimented in this machine, but there is one to note that we need to download the browser's driver files separately [ie:https://code.google.com/p/selenium/ downloads/detail?name=iedriverserver_win32_2.32.3.zip,chrome:https://code.google.com/p/chromedriver/downloads/ List] After download, put the driver files into the system path path, such as: System32 folder.

Python Webdriver's apihttp://selenium.googlecode.com/git/docs/api/py/index.html

Selenium servers is a jar package, because Selenium was originally written in Java and later extended to support so many languages; This server is in the selenium2. The main function of x is to execute the selenium script on the remote machine to achieve the purpose of remote and distributed execution, and this function is attached to the subsequent grid. How this service is started: Java-jar Selenium-server-standalone-2.32.0.jar

Grid has what it is! This is the extension component of selenium, and we can use this component to plan the execution and implementation of automated scripts well. With the functionality provided by this component, we can control the execution of all scripts on a single machine [which use case is performed in the browser on which host] and the work of the result collection. Very magical and convenient features, if packaged to improve its ease of use this will greatly improve our efficiency in automating implementation.

Selenium has a lot of developer support, so the IDE has a lot of plugins to choose from, this plug-in can help us to better and more efficiently complete the work of the automation process. We can also find a lot of these plugins on the Selenium download page, thanks to these developers for their selflessness.

In addition to the above features provided by selenium, it is necessary to do a lot of other work and extension functions to do automation work, such as results storage and statistical functions, fault-tolerant function, function of multiplexing, automatic construction, parameterization and so on. In fact, in addition to these basic work, the most important thing is to understand the project and the understanding of automation, because not all projects are suitable for automation, and not all automation projects need to achieve how much automation coverage. The correct use of ideas to better complete the work, or abandon the end of the chase may ultimately lead to only the consumption of time, there is no benefit.

Selenium officially supported languages:
Java, C #, Python, Ruby
Third-party supported languages:
PHP, Perl, Haskell, Objective-c

Selenium officially supported browsers:
ie, FF, Android, IOS
Third-party supported browsers:
Chrome, Ghostdriver, Opera

A picture to understand Selenium2.0 's running logic

selenium2.0 Basic Concepts

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.