Create a Maven project.
Add selenium-java client dependencies in pom.xml
Add TestNG or JUnit dependencies in pom.xml
And finally Selenide dependencies
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>3.7</version>
<scope>test</scope>
</dependency>
Add a simple TestNG/ Junit class
importstatic
com.codeborne.selenide.Selenide.*;
importstatic
com.codeborne.selenide.Condition.*;
public class Test
{
@Test
publicvoid
userCanLoginByUsername()
{
open("/login");
$(By.name("user.name")).setValue("johny");
$("#submit").click();
$(".loading_progress").should(disappear);
$("#username").shouldHave(text("Hello, Johny!"));
}
}
Just Run it.
No comments:
Post a Comment