Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Selenide vs Geb

Selenide vs Geb

Presentation slide which is presented on JJUG CCC 2016 Spring Night Meetup.
日本語版はこちら:https://speakerdeck.com/poohsunny/seleniumtogeb

PoohSunny

May 21, 2016
Tweet

More Decks by PoohSunny

Other Decks in Technology

Transcript

  1. @Before write sample code with both tools • move to

    google search page • enter"Selenide" or "Geb" • assert page should have 10 records • assert first record include searched word.
  2. Selenide2 public class GoogleTest { @Test public void userCanSearch() {

    GooglePage page = open("http://google.com/", GooglePage.class); SearchResultsPage results = page.searchFor("selenide"); results.getResults().shouldHave(size(10)); results.getResult(0).shouldHave(text("Selenide")); } } 2 https://github.com/selenide-examples/google/blob/master/test/org/selenide/examples/ google/selenidepageobject/GoogleTest.javaΛϕʔεʹҰ෦มߋ
  3. Geb @RunWith(JUnit4) public class GoogleTest extend GebTest { @Test def

    userCanSearch() { to GooglePage searchFor("Geb") at SearchResultsPage assert results.size() == 10 assert results[0].text().contains("Geb") } }
  4. Comment from Geb commiter You can use WebDriver's implicit wait

    stuff, but I don't publicise it. It makes developing/debugging painful and trying to sweep asynchronicity under the rug doesn't work in practice in my experience.
  5. Comment from Geb commiter If Geb were remade to avoid

    dynamism, it wouldn't be recognisable as Geb as you say.
  6. Comment from Selenide commiter • implicit wait doesn't work well

    • can only wait for element to appear. • Selenide does it's own waiting mechanism. • you can also wait for element even dissapper $("#resultDiv").shouldHave(text("Hello")); $(".error").should(disappear);
  7. Summary Selenide • Java • No need to consider about

    waiting Geb • Groovy • Need to write waiting explicitly