Thursday, May 21, 2020

Solved: How to fix Exception in thread "main" java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError ?

Some of you might be experiencing below error while executing tests via TestNG:

[RemoteTestNG] detected TestNG version 7.0.1
Exception in thread "main" java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: com/google/inject/Stage
    at org.testng.internal.Configuration.<init>(Configuration.java:33)
    at org.testng.TestNG.init(TestNG.java:216)
    at org.testng.TestNG.<init>(TestNG.java:200)
    at org.testng.remote.AbstractRemoteTestNG.<init>(AbstractRemoteTestNG.java:17)
    at org.testng.remote.support.RemoteTestNG6_12.<init>(RemoteTestNG6_12.java:18)
    at org.testng.remote.support.RemoteTestNGFactory6_12.createRemoteTestNG(RemoteTestNGFactory6_12.java:16)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:67)
Caused by: java.lang.NoClassDefFoundError: com/google/inject/Stage

How to Fix?

Saturday, April 25, 2020

Module 9: All you need to know about TestNG


Hi Guys!

It's high time convert our framework to TestNG now.

Right click on project-->TestNG-->Convert to TestNG
This will create a testng.xml at root folder. We will understand and work on it later. Meanwhile, sharing a few annotations you need to get familiar with!

TestNG Annotations

@BeforeSuite: Executes before the execution of all the test methods in the Suite.

Wednesday, April 22, 2020

Module 8: Logging Utility : log4j logging in Selenium Automation Framework

<<<Previous Chapter

log4j logging in Selenium Automation Framework
Hi Guys! We have already developed two utilities for our Selenium Automation framework in previous tutorials namely, 
Initializing Browsers & Capturing Screenshots 
and TestNG Listeners

Today we are going to develop our 3rd and last essential utility Log.java. It contains all the common methods that will need for our logging mechanism.

Create a Utility for logging.

Create new class with name log.java in Utility Package as we created Listeners in previous tutorial, Copy and paste below code in it: (Documentaion embedded in the snippet itself)

Tuesday, April 21, 2020

Module 7: TestNG Listeners | Selenium Automation Framework

Listeners "listen" to all the events marked in our Selenium Scripts being executed in our Test Run. They act accordingly as per definition. Listeners allow us to perform certain actions when the said events get triggered.

Hi Guys! We will just add a new class listeners.java today in our utility package we created in yesterday's tutorial. It would be great in case you can read about TestNG listeners over the internet just to clear out any doubts and have a clear picture of listeners. That's Homework, Do it... Follow the white Rabbit :P 

Solved: bash: make: command not found | make build error on Windows | Docker

Many of you might be using Docker on windows systems. If you are using Git Bash as terminal "make" command might not work for you. 

and you will get below error on executing $make build: 

 bash: make: command not found 

In order to fix this:

Cheers! Happy Testing :)