Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 13 additions & 22 deletions post.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# Introduction
## Introduction

**What is Selenium?**
An excerpt from Selenium's [home page](http://seleniumhq.org),
> Selenium automates browsers. that's it.

Selenium allows you to emulate user interaction with a web page.
<br><br>

---
### Prerequisites

# Prerequisites
We need a few things first to get up and running using Selenium..

1. A JRE/JDK installed
Expand All @@ -20,15 +18,12 @@ We need a few things first to get up and running using Selenium..
**\#1**: **[Download and Install a JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html)**

**\#2**: **[Proceed to *Configuring your IDE* &raquo;](#configuring-your-ide)**
<br><br>

---

##Configuring your IDE
### Configuring your IDE

There are several IDE's out there such as Eclipse, NetBeans etc. In this tutorial, we will be using IntelliJ IDEA Community Edition to get you started because it is quick to get up and running with this tutorial.

### [&raquo; Download IntelliJ IDEA Community Edition &laquo;](https://www.jetbrains.com/idea/#community_edition)
> [&raquo; Download IntelliJ IDEA Community Edition &laquo;](https://www.jetbrains.com/idea/#community_edition)

On the IntelliJ IDEA Community Edition webpage, scroll down the page until you see Download links.

Expand All @@ -40,7 +35,7 @@ Once you've downloaded the installer, follow the steps through.

---

# Let's get started...
## Let's get started...
Follow these steps:

1. **We will click "Create New Project"**
Expand All @@ -63,7 +58,7 @@ Follow these steps:
5. Click finish. *Upon startup, you may see a "Tip of the Day" window pop up. Close this.* **At this point,** you will see an XML file open. This XML file is the Maven pom (or Project Object Model). The pom is a file dedicated to managing dependencies, and other configurations that your project has, such as plugins, and test goals.

6. With the Maven pom still open, we are ready to bring in the [Conductor framework](http://conductor.ddavison.io). The Conductor Framework is a wrapper around Selenium 2 that is extremely fast to get up and running with Selenium 2, as well as very easy to learn and easy to use. **In the pom XML file that is open,** We are going to type the following code under `<version>...</version>`.
```xml
```markup
<project...>
...
<version>1.0-SNAPSHOT</version>
Expand Down Expand Up @@ -109,8 +104,6 @@ You are looking at the standard project hierarchy for Maven.

First, [let's prepare our project &raquo;](#preparation) with the Conductor framework.

---

### Preparation

In order for Conductor (and Selenium for that matter,) you need respective WebDriver executables to be installed inside of the project path to use.
Expand All @@ -122,9 +115,7 @@ After you follow the instructions for your respective platform, you will see the
*Screenshot*
![chromedriver](http://i.imgur.com/8NfzTEk.png)

####[Continue to the test cases &raquo;](#the-test-cases)

---
> [Continue to the test cases &raquo;](#the-test-cases)

### The Test Cases

Expand All @@ -138,11 +129,11 @@ The test cases that we will be testing on SeleniumHQ.org, follow:

![case2](http://i.imgur.com/3BgIoOo.png)

#### [Proceed to writing the library... &raquo;](#writing-a-library)
> [Proceed to writing the library... &raquo;](#writing-a-library)

---

# Writing a library
## Writing a library

In order for Selenium to know what to interact with, a good practice that the Conductor framework fits well with, is to map the elements you need in your application inside of a Java class.

Expand Down Expand Up @@ -202,7 +193,7 @@ Now that our library is prepared, let's **[Continue on, and write our test &raqu

---

# Writing the test
## Writing the test

*We will be using jUnit in this tutorial, which comes packaged with IntelliJ.*

Expand Down Expand Up @@ -260,7 +251,7 @@ public class SeleniumHQTest extends Locomotive {

```

## Test Case #1 - Validate that the download link exists.
### Test Case #1 - Validate that the download link exists.
```java
public void testDownloadLinkExists() {
validatePresent(HomePage.LOC_LNK_DOWNLOADSELENIUM);
Expand All @@ -272,7 +263,7 @@ Here, we are just validating that the `LOC_LNK_DOWNLOADSELENIUM` (The "Download

> **Right click the method `testDownloadLinkExists` and click `"Run testDownloadLinkExists()"`**

## Test Case #2 - Validate that all tabs exist.
### Test Case #2 - Validate that all tabs exist.
```java
public void testTabsExist() {
validatePresent(HomePage.LOC_LNK_PROJECTSTAB)
Expand All @@ -291,7 +282,7 @@ One of the beautiful things about the Conductor framework which makes it so easy

---

# Conclusion
## Conclusion
This is the end of the tutorial, and I do hope this helped you see how Selenium can work using Java.

It should be noted that by no means are you required to use the Conductor framework in your Selenium future, we had used the Conductor framework in this tutorial to show you a good effective test writing strategy.
Expand Down