LeanFT TestNG Framework – Kicking off your Automation!

So you’ve learnt the basics of LeanFT. What next ?

The obvious answer would be to start writing a Framework. Before you start fishing in the troubled waters, let me do a reality check. In my 7 years of experience, I have been writing frameworks for more than half the time. Trust me I could have done with using code that other people have written 🙂

That is exactly what I intend to do with this blog entry! Providing a starting point for people so that we can focus on what’s really important – AUTOMATION rather than framework creation. Some of the weapons in my arsenal(read components of the framework) include:-

  1. TestNG – The undisputed king when it comes to testing frameworks
  2. Maven – The defacto build automation tool for Java
  3. LeanFT – Our favourite test automation SDK 🙂
  4. Page Object Model is used for better organisation of the code.
  5. Log4J logs all the important events.

The code for the Framework can be found on this GitHub link. It can be used as a template to write your automation code. Feel free to fork it !

FYI: This framework should be easy to understand if you’ve worked with Selenium based frameworks before. In case of any difficulty in understanding, feel free to comment.


Happy Automating!

Harshit Kohli



16 thoughts on “LeanFT TestNG Framework – Kicking off your Automation!

  1. Sorry to comment again, Can you help me connect LeanFT to JavaFX. I have UI in JavaFX & want to use LeanFT for developer friendly testing techniques. ( similar to Junit )

    1. Hi Birendra,

      As per the 12.5 release of LeanFT, JavaFX applications should be supported. You can spy on them just like the Web objects in the tutorials on my blog. Just make sure you have the Java Add-in selected by right clicking the LeanFT icon in the taskbar and then selecting the add-in from the available options.

      Is there any specific problem you need help with ?

    2. Thank you Harshit. I spent most of my day trying to set up my first LeanFT project. Your GitHub Template Master worked perfectly! I’d like to follow you on Twitter and invite you to my Automation group on Facebook. @DarkArtsWizard

    1. Hi Omer…you’re correct, it’s that simple 🙂 just “mvn test” from the directory which houses the pom.xml provided the pom.xml has the surefire plugin configured to call the testing.xml

      1. Got it worked thanks! 🙂
        I’ve got another question if you don’t mind, I want to export the project as a jar, do I need another maven plugin(maven-jar-plugin)? I want to execute the tests that in the jar.
        My main goal is to run the tests inside the LeanFT docker container.
        thanks a lot!

  2. your’re welcome Omer 🙂

    yes, you need the plugin in the pom.xml and you need to execute the “mvn package” command, the jar would get created inside the target folder

      1. Ok, to execute the tests the command should be “java -testjar myTests.jar -xmlpathinjar myTests.xml” ?

  3. I have not executed my tests this way, the best way according to me is to get the code inside the container and execute the mvn test command from the directory where the pom.xml is present

    1. Ok that is what I thought either, but since the official image doesn’t have maven installed I looked for another way.
      Did you extended the image and installed maven?
      Thanks for all the information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s