Selenium Web Automation Wiki



Welcome to the Selenium Web Automation Wiki
Introduction by SeleniumMaster An information repository to share public knowledge about Selenium WebDriver API as it relates to software development QA for website test automation. The code examples and methods demonstrated in this wiki are for general educational purposes (but there's nothing stopping you from copy\pasting the code into your own codebase, much the same as if you had gotten it from Stack Overflow or other such online exemplifications), and every effort in good faith has been and will be made by the administrator, SeleniumMaster, to ensure that the code samples\examples contained herein have been scrubbed to comply with private corporate NDA's.

Using scrubbed "dummy data" is permissible if its aim is to show how to do something, and if the private corporate data has been "de-coupled" from the general form of the algorithm, then there should be no problem to achieve compliance with corporate NDA's. This is proceeding under the theory of code re-use by examples, in which all software engineers and QA automation engineers may benefit from the trade of publicly accessible knowledge. If necessary, the right to share knowledge in this manner that has in good faith been rendered "scrubbed" may be defended legally as necessary. Private corporations may control what their programs are doing and retain privacy over their data, but in general unless you're Oracle or Microsoft, you don't "own" Java, C#, or Selenium, you license them from Oracle or Microsoft or Selenium HQ, and the knowledge of "how to use Java, C#, or Selenium" is freely available on the internet.

Any public editors of this wiki are encouraged to remind themselves of any contractual NDA's they may be under, to make the best and reasonable effort to scrub any sharing of your code algorithms to comply, and to take that into account when editing or using any of the examples, and of course, remember the fact that Wikia itself catalogs your IP address if you make any edits, so please refrain from any juvenile wiki vandalism and such (of course, I have much faith in any user or editor of this website as most people who work in software development are middle-class, educated, professional adults).

What is Selenium?

Selenium of course is owned by SeleniumHQ. Selenium is the premier free, open-source choice for professional website test automation, supporting a plethora of implementation languages including popularly Java and C#. Whether your practice is a Java shop or a Microsoft .NET shop, using Selenium WebDriver API, it is possible to create robust, maintainable automation architectures and frameworks to support enterprise software development automation needs.

Selenium WebDriver is not record-and-playback. General industry opinion is that record-and-playback is not "real" automation, it results in brittle, easy to break, unmaintainable tests. Although record-and-playback (RnP) has its uses, it is preferred to use Selenium or other customizeable frameworks that result in tests being better for maintenance purposes, whether it is data-driven, keyword-driven, or data embedded in the scripts, there is always a smarter way to do things, and it is the aim of this wiki to uncover better ways, and to catalog that knowledge and information so it is not lost, so it can be re-used, quickly and efficiently.

In order to use Selenium WebDriver API in Java or C#, one requires knowledge of object-oriented programming, data structures, and experience coding in that language (and optionally, knowledge would be helpful of basic relational database management systems such as Microsoft Access, Microsoft SQL Server, or Oracle). It is not the purpose of this wiki to teach people how to code, use data structures and design patterns, and\or use SQL databases, as other institutions, books, and resources exist for those purposes. Rather, this wiki will assume the reader\user already knows basic computer science and will provide quick, easy to use references by providing a knowledge transfer of how to use Selenium API to do things. The intended audience are QA, automation engineers, developers, and anyone else interested in learning more about website automation or in improving their automation codebases in their daily practice. There is no best way of doing anything, there is only but one way among many, and the user is encouraged to take the examples and then re-adapt them for greater efficiency and maintainability in their own codebases.

-- SeleniumMaster, 1/9/2015

 Table of Contents 

Selenium Simple Example