Iam not able to add listner class/import the listener class. | Selenium Forum
S
sai karthik Posted on 24/07/2020

package listener;

public class Mylistener implements ITestListener
{

}

 

 

 

getting Recolor mark at ITestListner showing some suggestions but showing the import.itestlistner class in those options


S
sai karthik Replied on 24/07/2020

not able to view that import class 

Responsive image

A
Ashish Thakur Replied on 24/07/2020

Have you included testng as a lib in the project?


S
sai karthik Replied on 24/07/2020

i have added it in the pom.xml file

Responsive image

S
Sarabjit Singh Bansal Replied on 26/07/2020

Hi Karthik,

I can see you have used TestNg 7.0 in the pom.xml file.  Read the below text which states that you now have to perform few additional steps.

 

" As i got to know from the below link - TestNG 7.0.0 uses JDK8 and with it default methods within interfaces. What this means is that every listener would now have a default implementation (which doesn't do anything ) for all methods defined within the interface.

So now you won't see those indications from the IDE. The biggest benefit of default methods in interfaces is that let's say you are implementing an interface that has 10 methods defined in it, you can just implement whatever you need and the rest of the behavior comes via the default methods in the interface. Reference- https://github.com/cbeust/testng/issues/1964"

 

 

My Suggestion : Try using 6.14.3 for now


S
sai karthik Replied on 26/07/2020

Thanks for the support and suggestion.