Selenide vs Geb

Selenide vs Geb

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

B765faf519f19520e1495bd870f4d7f0?s=128

PoohSunny

May 21, 2016
Tweet

Transcript

  1. Selenide vs Geb

  2. @PoohSunny { role : father children : 2 work :

    house keeping }
  3. lots of browser automation tools!

  4. How do we decide which to use !?

  5. Talk Selenide & Geb commiters1 in github issue 1 https://github.com/codeborne/selenide/issues/65

  6. Read the talk and diffenciate them!

  7. NOTE: this talk was held around 2 yrs ago.

  8. @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.
  9. 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ΛϕʔεʹҰ෦มߋ
  10. 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") } }
  11. handling wait Selenide $("#resultDiv").shouldBe(visible); Geb waitFor { theResultDiv.present } Selenide

    waits automatically.
  12. pure Java ? Selenide: Yes! Geb: No!

  13. 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.
  14. Comment from Geb commiter If Geb were remade to avoid

    dynamism, it wouldn't be recognisable as Geb as you say.
  15. 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);
  16. Summary Selenide • Java • No need to consider about

    waiting Geb • Groovy • Need to write waiting explicitly
  17. Both hate implicit wait

  18. Fin.