Selenium webdriver VS Selenium RC

Source: Internet
Author: User

What the hell is Webdriver? Webdriver is a web-enabled automated testing framework that allows you to execute your test cases on different browsers and not just Firefox as selenium. Webdriver also allows you to create your test scripts in a programming language (which is not possible in the Selenium IDE).
    • You can use conditional judgment statements, like If-then-else or switch-case.
    • You can also use looping statements, such as Do-while.
The following programming language Webdriver are supported:
    • Java
    • . Net
    • Php
    • Python
    • Perl
    • Ruby
You don't need to know all the programming languages. You just need to know one of them to be OK. In the following example, we will use Java. webdriver Vs Selenium RCWebdriver Selenium Remote Control existed before it came out in 2006. The Webdriver and selenium RC support the following features:
    • Both of them can use programming languages to design your test script language
    • Can support your test run on a different browser
So what's the difference between them? Let's discuss this issue together: Architecture (Architecture)   the structure of the selenium is simpler than the selenium RC:
    • Control the browser from the OS level
    • All you need is just to compile your programming language IDE (including your selenium command) and a browser
The structure of the Selenium RC is relatively more complex:
    • Before you start your test, you first need to open a call selenium Remote Control (RC) Server (Java-jar Selenium-server-standalone-2.xx.xx.jar)
    • Selenium RC server acts as a mediator or intermediary between your Selenium command line and your browser
    • when you start the test, the Selenium RC The server injects a piece of JavaScript code (also known as Selenium Core) to the browser
    • once the JS injection succeeds, Selenium Core will accept the instruction and relay it through the RC server from your test program
    • Contemporary code is accepted, Selenium Core will convert the code to JS to execute
    • The browser obtains the code for selenium core and then propagates the response back to RC Server
    • The
    • RC server will accept the browser's response and then display the results in front of you
    • RC server keeps getting the next piece of code from your test script, repeating one cycle at a time
So we can see that webdriver is faster than Selenium RC, Webdriver is directly controlled by the engine of the browser itself, but RC needs to call Selenium Core,selenium via JS.                                                          The core is the one that controls the browser directly, not you. Vs Selenium Webdriver Selenium RC The actual interaction is this:                                                       ,         &NB Sp The interaction between           webdriver and page elements is more straightforward. For example, if you have a disabled text box on your test page, webdriver in this case cannot enter any text content like a real person cannot do this thing.                          ,         &NB Sp                                                           ,         &N Bsp             selenium Core, like any other JavaScript code, is a page element that can find and manipulate this Disabled. In the past, Selenium Tester always complained that Selenium core was able to enter values into disabled text boxes. This is mainly due to different APIs. The   selenium RC API is more mature, but contains too many confusing commands. For example, tester always wondered whether to use type or Typekeys, or click Better or MouseDown or Mousedownat. What's worse, different browsers use different ways to compile these commands. The  webdriver API is relative to the SELEnium RC is much simpler, and it doesn't have a lot of confusing commands.   Browser support: Webdriver supports headless Htmlunit's browserHtmlunit is called "Headless" because it is a browser that is not visible, it is lack of provincial boundaries surface. It's very fast and it doesn't need to load the time the page element waits, it can speed up your test execution. Because it is invisible, it also means that it can only be manipulated by automation. Selenium RC does not support headless Htmlunit browser, it requires a real visible browser to operate. Webdriver is not omnipotent, it also has a restricted place: Webdriver support for new browsers is not so easyWe have to understand that Webdriver's operations are dependent on the level of the OS. It is also learned that communication between different browsers and systems is done in different ways. If a new version of the browser appears, it may have a different flow between the communication between the system and the other browsers compared. So you need to give the Webdriver team some time to implement the new approach to the new browser. Selenium RC module with an inline output test resultSelenium RC automatically generates test results for an HTML file. The format of the report is defined by the RC itself. Here's an example to see: Webdriver is not a module that automatically generates test reports, you need to rely on the IDE's Output dialog box, or use a programming language to Write a test report. Summary
    • Webdriver is a Web Automation test tool that supports multiple programming languages and can operate on multiple browsers
    • You can create powerful test script cases because Webdriver allows you to design your test cases in the programming language of your choice
    • Webdriver is faster than selenium RC because of its simple architecture
    • Webdriver interacts directly with the browser, while the selenium RC requires the help of RC server to achieve the same functionality
    • Webdriver API is simpler than selenium RC API
    • Webdriver can support Htmlunit, then selenium RC cannot support
    • The disadvantage of Webdriver is: 1. It is not well supported by the new browser, RC can. 2.WebDriver no built-in module to generate test reports

Selenium webdriver VS Selenium RC

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.