Quick Start

Blog

Quick Start

It's extremely easy to start using Selenide. Definitely not a rocket science.

Just add selenide.jar to your project and you are done.
Here is the quick start guide to get you started.

How to write UI test in 10 minutes

For Maven users:

Add these lines to file pom.xml:

<dependency>
    <groupId>com.codeborne</groupId>
    <artifactId>selenide</artifactId>
    <version>3.7</version>
    <scope>test</scope>
</dependency>

For Ivy users:

Add these lines to file ivy.xml:

<ivy-module>
  <dependencies>
    <dependency org="com.codeborne" name="selenide" rev="3.7"/>
  </dependencies>
</ivy-module>

For Gradle users:

Add these lines to file build.gradle:

dependencies {
  testCompile 'com.codeborne:selenide:3.7'
}

Start writing test

So easy! No more boring routines, we can start.

Import required classes:

import static com.codeborne.selenide.Selenide.*;
import static com.codeborne.selenide.Condition.*;

and write test:

@Test
public void userCanLoginByUsername() {
  open("/login");
  $(By.name("user.name")).setValue("johny");
  $("#submit").click();
  $(".loading_progress").should(disappear); // Waits until element disappears
  $("#username").shouldHave(text("Hello, Johny!")); // Waits until element gets text
}

Ready!

You can choose any testing framework you prefer: JUnit, TestNG, Cucumber, ScalaTest, JBehave - whatever.

Run as a usual tests. You can run from IDE, or as an ANT script, or “mvn test”. You don’t need to change anything in your process.

Do you want to see a working example?

We created Selenide examples group on github with examples of using Selenide:

etc.

Share your examples!

If you have any examples of Selenide usage, feel free to share them with us!

Video tutorial

How to start writing UI tests in 10 minutes from Selenide on Vimeo.

Selenide tutorial



blog comments powered by Disqus

The project is maintained by