Search code examples
selenium-webdriverjunittestngjenkins-cli

Does Selenium- Jenkins Integration needs TestNG or JUnit Framework


Should we need TestNG or Junit framework to integrate Selenium with Jenkins. I have project which is build without TestNG or JUnit can i integrate it with Jenkins.


Solution

  • TestNG and JUnit on simple terms can be visualised as "java code execution" mechanisms with support to do validations. So instead of you having only one main() method that would be the single point of entry for execution of your selenium code, TestNG/JUnit takes up that role and lets you run multiple java classes via themselves.

    Jenkins is an orchestrator tool that lets you build, test, deploy as per your wish.

    The test phase can be skipped by not using TestNG and JUnit, and you resorting to executing your selenium based tests via a main() method which takes care of doing all validations as well (assertions in the JUnit/TestNG world)