selenium--Family Introduction

Source: Internet
Author: User
Tags selenium grid

After installing the configuration environment, start my selenium journey. A simple look at the color, selenium the composition of the family.

Selenium is a functional testing tool developed specifically for WEB applications by ThoughtWorks. Selenium uses JavaScript and iframes to embed an automated test engine in a browser that can work in any JavaScript-enabled browser to simulate the user's actions in the browser. The power of selenium is that you can use the integrated development environment to allow users to debug with their most familiar development language.

Advantages of Selenium:

1) It's open source.

2) Simple, easy to install, easy to work

3) Provide selenium IDE, a Firefox plugin, can automatically record user's operation, generate test script. The generated test script can be run automatically based on the selenium RC into the unit test case of Java,c#,ruby. Selenium IDE is the only component of selenium that can record user behavior on a browser window

4) No other events on your computer will be recorded except for events on Firefox

5) Selenium supports multiple browsers and is capable of running with multiple operating systems, making it easier for testers to discover compatibility issues with applications on different browsers. It is easier to discover browser incompatibilities by running tests in different browsers.

6) by writing a Selenium test script that mimics the user's actions, the application can be tested from the perspective of the end user, manipulating various elements on the Web page, such as clicking a button, entering a text box, and asserting that some text and web elements exist on the Web page.

7) Test cases invoke the actual browser (ie, FireFox) to perform the test.    Compared with some open source solutions, the actual browser can simulate more user interaction and JS syntax than the Web interpretation engine itself. 8) The selenium recorded script is more flexible because it generates Perl scripts. As one of the most powerful and widely used languages, Perl is a program that gives me the greatest degree of flexibility and control.

Selenium IDE Support and only support Firefox browser, supported by too few browsers, and attached to Firefox is not easy to carry out automated testing later, but it is fast and easy to record! and a code conversion function, you can convert the Selenium language test case to a test case in a language such as C#,java, use Selenium IDE + FireBug to write a test case, and then switch to a test case in another language, then call Selenium RC to run the test case 。

Selenium RC It supports many browsers, can write test cases in languages such as C#,java, is easy to maintain, provides good extensibility, and will use the Selenium RC test tool.

A new Selenium 2 framework was created after selenium and webdriver together shipowner. Selenium is a very good framework for Web application testing. He has some positive effects. Webdriver also does not need an agent like Selenium 1. You can chat directly with the browser. This is also very popular because you can speed up the execution of your tests without requiring an "intermediary" to deliver messages.

Selenium IDE: a table of right command, target, value is a script, each script is a section of action behavior, action has three components of CTV, command is the various functions in the API, Target is a target object in the Web, such as an input box, a button, and so on, using XPath to select an object. Value: Fill in according to the actual content.

Here you can manually add two kinds of page checks: Verify and Assert. They are able to verify the display content, output, etc., the difference is:

Verify: The validation fails and throws an error that the expected result does not exist, but the test process continues with the following steps, but it is shown in red.

Assert: Validation failed and the test will not continue.

Selenium doesn't indicate that it waits for an element that needs to interact, so you'd better wait until you need the interaction element to appear and then daemons the line interaction, which is to take advantage of the wait command. If you have a drop-down menu, you have to wait for the page with Ajax, and then the page elements are ready for the next steps.

Selenium RC: There are two components

Selenium server: Responsible for controlling browser behavior, including three parts: Launcher, HTTP proxy, Selenium core, where Selenium core is Selenium Server embedded in the browser page, Selenium Core is a collection of JS functions that enable the operation of the browser.

Selenium clientlibrary: The library used to control the server when writing a test case.

Support many browsers, can use C#,java and other languages to write test cases, easy to maintain, while providing good extensibility.

The Selenium Grid allows the creation of many Selenium RC instances, which are sent by a central Selenium RC command. With a hub hub, the test can connect to this point, and the test command is pushed to the remote RC instance connected to the hub. The center has a web interface (localhost:4444/console) that tells you the selenium RC instance that is connected to this hub, and returns the status of whether the instance is in use.

# Start Selenium Server
Java–jar Selenium-server-standalone-2.22.0.jar-port 4444

# Launch hub for selenium grid
Java–jar Selenium-server-standalone-2.22.0.jar-port 4000-role Hub

# Start Selenium grid node, where the-hub parameter is the URL of the hub of the selenium grid
Java-jar selenium-server-standalone-2.22.0.jar-port 4001-role Node-hub http://127.0.0.1:4000/grid/register

#显然, you can start multiple node:
Java-jar selenium-server-standalone-2.22.0.jar-port 4002-role Node-hub http://127.0.0.1:4000/grid/register

Webdriver

Webdriver provides an advanced technology to locate Web page elements. In fact, Webdriver is based on the selenium of an automated test class library, but it is no longer running in the browser of the JS program, but it can control the browser. Webdriver provides a number of ways to locate elements, with APIs related to languages of different platforms, such as C #, Java, Python, Ruby, and so on.

The previous period of time to use spare time to learn this knowledge, it is now a little bit of sorting out.

selenium--Family Introduction

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.