Need advice about which tool to choose?Ask the StackShare community!

Selenide

57
85
+ 1
16
TestNG

474
197
+ 1
0
Add tool

Selenide vs TestNG: What are the differences?

Key Differences between Selenide and TestNG

Selenide and TestNG are two popular tools used in software testing, but they have distinct differences in their functionalities and features.

  1. Test Framework vs. Browser Automation Library: Selenide is primarily a browser automation library built on top of Selenium WebDriver, providing a more user-friendly and concise API for writing browser automation tests. On the other hand, TestNG is a full-fledged test framework that supports various test types, including unit, functional, and end-to-end tests, offering advanced test management and reporting capabilities.

  2. Configuration and Dependency Handling: Selenide focuses on simplicity and minimizing the need for configuration. It provides sensible default configurations and automatically manages dependencies such as browser drivers. In contrast, TestNG allows more flexibility in configuring various aspects of test execution, such as test parallelization, test dependencies, and custom listeners.

  3. Test Organization and Execution: Selenide encourages a more structured test organization by providing out-of-the-box support for Page Object Model (POM) pattern and Fluent Interface design. It also simplifies test execution by handling dynamic waits and synchronizations implicitly. TestNG, on the other hand, provides a comprehensive test organization framework with annotations, allowing users to create test suites, set up pre and post test conditions, and define test priorities and groups.

  4. Assertions and Verifications: Selenide enhances the assertion capabilities of Selenium WebDriver by providing a set of highly expressive and concise methods for element checks and page validations. It also automatically retries assertions for a configurable period, reducing the flakiness of browser tests. TestNG offers a range of assertion methods as part of its assertion API, enabling users to perform complex verifications and define custom assertion failure messages.

  5. Test Reporting and Logging: Selenide provides built-in reporting capabilities that generate clear and concise HTML reports with screenshots, detailed error messages, and failed browser console logs. It also outputs rich logging information during test execution. TestNG, being a comprehensive test framework, offers customizable report generation with detailed test execution results, including configuration parameters, test durations, and test failures, which can be integrated with various tools such as Jenkins.

  6. Test Data Management: Selenide does not specifically provide features for managing test data. Users need to handle test data independently, either by creating test data in test fixtures or by utilizing external test data providers. In contrast, TestNG includes features for parameterizing tests and supports various data providers, enabling users to supply test data from different sources (e.g., XML, CSV, databases) for data-driven testing scenarios.

In summary, Selenide is predominantly focused on simplifying browser automation and enhancing the Selenium WebDriver API, while TestNG provides a broader set of features for comprehensive test organization, execution, and reporting, including support for multiple types of tests and advanced test data management capabilities.

Advice on Selenide and TestNG
Needs advice
on
CypressCypressSelenideSelenide
and
WebdriverIOWebdriverIO

Hi, I am starting out to test an application that is currently being developed - FE: React. BE: Node JS. I want the framework to be able to test all UI scenarios (from simple to complex) and also have the capability to test APIs. I also need to run tests across all OSs and Browsers (Windows, Mac, Android, iOS). I have also looked into react-testing-library and @TestProject.io. Any advice you can give as to which framework would be best and why would be so much appreciated! Thank you!!

See more
Replies (3)
Recommends
on
PlaywrightPlaywright

You should also definitely look into Playwright, which is a new automation tool from Microsoft building on top of the Puppeteer experience and trying to bring this experience in the cross browser space - very exciting project. Great team. Also CodeceptJS as already Playwright support which at a ton of valuable features on top of Playwright, give it a go!

See more
Jinesh Khimsaria
Test Automation Specialist at Personal · | 3 upvotes · 76.7K views
Recommends
on
WebdriverIOWebdriverIO

I'm also looking for the same, FE: React & BE: NodeJS. Cypress won't help as it lacks cross-browser testing, it doesn't support all the browsers. I'm still investigating it, but looks like WebdriverIO may fulfil what I'm looking for - Cross-browser testing, integration with CI/CD, running it as a docker service, good support on assertions & reporting of test results. Let me know if you found any information on any of the above mentioned points.

See more
Recommends
on
CodeceptJSCodeceptJS

Hi Esther, if you really need cross OS and cross device automation Cypress wont help, with WebdriverIO you can do it … and check out CodeceptJS, which is a wrapper around several frameworks (like WebdriverIO) and will support future players (currently for example upcoming Playwright) as well.

See more
Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of Selenide
Pros of TestNG
  • 5
    Nice JAVA API
  • 2
    Very mature API
  • 2
    File upload support
  • 2
    Integrated with WebDriverManager project
  • 2
    Integrated with Selenium-Jupiter framework
  • 1
    Capture screen shots on fail
  • 1
    Cross browser
  • 1
    Proxy server
    Be the first to leave a pro

    Sign up to add or upvote prosMake informed product decisions

    Cons of Selenide
    Cons of TestNG
    • 1
      Hybrid page model not possible
      Be the first to leave a con

      Sign up to add or upvote consMake informed product decisions

      What is Selenide?

      It is a library for writing concise, readable, boilerplate-free tests in Java using Selenium WebDriver.

      What is TestNG?

      It is a testing framework designed to simplify a broad range of testing needs, it covers all categories of tests: unit, functional, end-to-end, integration, etc.Run your tests in arbitrarily big thread pools with various policies available (all methods in their own thread, one thread per test class, etc.

      Need advice about which tool to choose?Ask the StackShare community!

      What companies use Selenide?
      What companies use TestNG?
      Manage your open source components, licenses, and vulnerabilities
      Learn More

      Sign up to get full access to all the companiesMake informed product decisions

      What tools integrate with Selenide?
      What tools integrate with TestNG?

      Sign up to get full access to all the tool integrationsMake informed product decisions

      What are some alternatives to Selenide and TestNG?
      Selenium
      Selenium automates browsers. That's it! What you do with that power is entirely up to you. Primarily, it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should!) also be automated as well.
      Cypress
      Cypress is a front end automated testing application created for the modern web. Cypress is built on a new architecture and runs in the same run-loop as the application being tested. As a result Cypress provides better, faster, and more reliable testing for anything that runs in a browser. Cypress works on any front-end framework or website.
      Protractor
      Protractor is an end-to-end test framework for Angular and AngularJS applications. Protractor runs tests against your application running in a real browser, interacting with it as a user would.
      Geb
      It brings together the power of WebDriver, the elegance of jQuery content selection, the robustness of Page Object modelling and the expressiveness of the Groovy language.It can be used for scripting
      Git
      Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
      See all alternatives