Why selenium 2




















Want to support the Selenium project? Learn more or view the full list of sponsors. Selenium Projects Selenium has many projects that combine to form a versatile testing system. Selenium WebDriver Selenium WebDriver drives a browser natively, as a real user would, either locally or on remote machines. Simple and concise WebDriver is simple, it is designed as a concise and compact programming interface.

Works in all major browsers Through a simple setup, WebDriver can be used with all major browsers. Learn more. Web Ready Simple, turn-key solution to quickly author reliable end-to-end tests. Easy Debugging Enjoy easier test debugging with rich IDE features like setting breakpoints and pausing on exceptions. Selenium Grid Selenium Grid takes WebDriver to another level by running tests on many machines at the same time, cutting down on the time it takes to test on multiple browsers and operating systems.

That's it! What you do with that power is entirely up to you. Selenium WebDriver. Read more. Selenium IDE. Selenium Grid. Selenium Level Sponsors. Simon is stepping down as lead of the Selenium project. Going forward, both of these APIs will live side by side in a synergistic relationship, allowing automated test developers to easily leverage the right tool for the job.

It currently allows developers to target Firefox, Internet Explorer, and Chrome with automated tests. The remainder of this Refcard will focus on the WebDriver contributions to the Selenium 2. Download selenium-dotnet Compared to the other drivers, it is relatively slow. The Chrome driver is comparatively new.

Because Chrome is based on Webkit, you may be able to verify that your application works in other Webkit-based browsers such as Safari. However, because Chrome uses V8 JavaScript engine rather than the Safari Nitro engine, you may experience some differences in behavior. The HtmlUnit driver is the fastest and most lightweight of the group. It is the only pure Java implementation, so it is the only solution that will run anywhere the JVM is available.

Because it utilizes HtmlUnit to interact with your application instead of driving an actual browser, it carries along the associated baggage:. This allows you to maintain both WebDriver and Selenium test assets side by side and to engage in an incremental migration from Selenium to WebDriver. In addition, running the normal Selenium RC server is not required.

On the downside, you may notice some inconsistencies in behavior since the entire Selenium API is not implemented eg. You may also experience slower performance in some cases. These methods accept an argument of type By, which defines several static methods implementing different means of element location:.

In each case, findElement will return an instance of WebElement, which encapsulates all of the metadata for that DOM element and allows you to interact with it. WebDriver provides a support class named Select to greatly simplify interaction with select elements and their association options:. You can create an instance of Select fr om a WebElement that is known to represent a select element:. If the element does not represent a select element, this constructor will throw an UnexpectedTagNameException.

This is also how you can simulate mouse-hover events and perform drag-and-drop operations. The Page Object pattern is a useful tool for separating the orthogonal concerns of testing the logical functionality of an application from the mechanics of interacting with that functionality. Consider the Google home page. We could model this with the following Page Object Java :. By utilizing its initElements method, the driver element location code can be removed from the previous Page Object:.

A fully initialized version of this object can then be cr eated and used as in the following code snippet:. This version of initElements will instantiate the class. It works only when there is a one-argument constructor that accepts a WebDriver instance or when the default no-argument constructor is present. We can further clean up the code by providing meaningful names for the form elements and then using annotations to declaratively specify the location strategy:.

For those browsers that do not have native XPath support, WebDriver provides its own implementation.



0コメント

  • 1000 / 1000